On Thu, 28 Aug 2003 20:24:43 +0530,
[EMAIL PROTECTED] ("Shridhar Daithankar") wrote:

>On 28 Aug 2003 at 14:35, Sune Nielsen wrote:
>> INSERT INTO Users (name) VALUES ('JohnDoe');
>> SELECT CURRVAL('users_bid_seq');
>> 
>> This works perfectly(!), but my project involves multiple simultanous
>> users so I have to use transactions like this:
>> 
>> BEGIN;
>> INSERT INTO Users (name) VALUES ('JohnDoe');
>> SELECT CURRVAL('users_bid_seq');
>> COMMIT;
>
>You need to extract the current val first and explicitly use it in insert 
>statement. That way you won't have to produce work-arounds later..
As I could read from the reply from Tom Lane, it seemed that I only
needed to to remove the BEGIN and COMMIT in order to make it work.
What problems do you foresee if don't perform the queries in opposite
order? I'm kind of new to this stuff :-)

Thanks for your fast reply!


-- 
Sune Nielsen [EMAIL PROTECTED]
Student at 
Dept. of Computer Science 
Copenhagen University 
http://www.diku.dk

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

Reply via email to