in reply to Re: Re: Re: DBI and primary keys
in thread DBI and primary keys

the @@identity variable is per user session. To be frank, I've never done anything DBI work in the environment you're describing. That being said, you can check @@spid for each of your processes before you embark on this dangerous path. Unique spids should indicate @@identity is really unique for each process. Duplicate spids, should they appear, would indicate that your concern is correct.
And in any case, whatever you do with the advice is your own gig :) feel free to ignore.

Replies are listed 'Best First'.
Re: (boo) SQL session uniqueness
by $code or die (Deacon) on Mar 28, 2001 at 00:59 UTC
    It worked like this:
    INSERT INTO ......... SELECT @@IDENTITY as 'Identity';
    All in one statement, so after running execute, I did a call to fetch and got the identity. Nice!

    I really should go to bed - too much of a Perl(Monk) addict.

    $ perldoc perldoc