Re: Retrieving Identity Value of newly inserted row

"Mark Aufflick" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
<Sybase newby alert>

Couldn't DBD::Sybase internally cache the value of @@identity at the end
of each sql call that has an insert, which could then be returned later
if the method was called?

On 1/1/1970, "Michael Peppler" <[email protected]> wrote:

<snip>
>       will always return an identity value of 0, which is obviously incor-
>       rect.  This behaviour is due to the fact that the handling of ?-style
>       placeholders is implemented using temporary stored procedures in
>       Sybase, and the value of @@identity is reset when the stored procedure
>       has executed. Using an explicit stored procedure to do the insert and
>       trying to retrieve @@identity after it has executed results in the same
>       behaviour.
<snip>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.