the last resort is that you build some kind of stored procedure of your own which does this, from a datatable of some kind; essentially build yourself a sequence.
Lycovian <[email protected]> wrote: > Yep, terrible, there is not function to return this value similar to MySQL > and as Teradata doesn't support sequences there is no way to get the value of > the sequence in advance. Additionally, in Teradata, the identity value > number space is partitioned across all of it's available servers (called > AMPS) so the value of the Identity column is specific to whichever AMP > actually executed the INSERT so I can't even do a hacky ROW_COUNT() to try to > figure out what the "next" value might be. > > Other than using the ODBC setting to retrieve the lastrowid I'm not sure how > I could get the Identity column value without rendering all of the binds > inline. I've been researching it for about a week and other than this > settings I don't see how it could be done. Any other thoughts on how to > overcome this limitation would be welcome. > > > On Tuesday, January 13, 2015 at 5:09:18 PM UTC-8, Lycovian wrote: > The Teradata ODBC driver is capable of returning the lastrowid inserted on an > identity column if the appropriate ODBC.INI setting is enabled. > Unfortunately, for some reason, this functionality only works if the query > doesn't have bind parameters. Sigh. > > It not what I want to do but is it possible to get SA to render all of it's > queries sent to PyODBC with the bind variables inline so the query would be > executed as a un-parameterized query by the Teradata ODBC driver? > > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
