PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Mark Aufflick" <mark at aufflick dot com>
Subject: Re: Retrieving Identity Value of newly inserted row
Date: Jan 31 2006 11:47PM



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"  wrote:


>       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.