dbTalk Databases Forums  

@@SPID MS SQL alternative

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss @@SPID MS SQL alternative in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jan Blaha
 
Posts: n/a

Default @@SPID MS SQL alternative - 04-16-2004 , 04:09 AM






Hi I am looking for some way how to get some ID variable that remains
unchanged and unique throughout a connection, like MS SQL @@SPID. I am
running PostGreSQL 7.2.1 Native Windows Port. I would be thanksfull for
any help.
Thanks a lot
Honza


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #2  
Old   
Bruno Wolff III
 
Posts: n/a

Default Re: @@SPID MS SQL alternative - 04-16-2004 , 07:27 AM






On Fri, Apr 16, 2004 at 11:09:00 +0200,
Jan Blaha <jan.blaha (AT) terminus (DOT) cz> wrote:
Quote:
Hi I am looking for some way how to get some ID variable that remains
unchanged and unique throughout a connection, like MS SQL @@SPID. I am
running PostGreSQL 7.2.1 Native Windows Port. I would be thanksfull for
any help.
You could use a sequence to provide this. You will need to make an initial
call of nextval at the start of the session and then not call it again
(for the same sequence). Use currval to retrieve the id.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.