in reply to (Ovid) Re: Perl ODBC question
in thread Perl ODBC question

You will probably not be able to get the @@identity value if you use placeholders (I know this is so for Sybase, and I suspect it is for MS-SQL).

The problem is that the @@identity value is local to the currently executing code batch or procedure (which is a good thing, really), but as placeholders are implemented as temporary stored procedures the @@identity value is lost once the execution of the proc is done.

And you'd have to finish (free) the prepared statement anyway to run the query to fetch the @@identity value anyway, which would defeat (at least partially) the advantage of using prepared statements with placeholders.

Michael