cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves Vindevogel <yves.vindevo...@implements.be>
Subject Re: How can I get ID number after insert a new record?
Date Tue, 30 Mar 2004 21:16:42 GMT
I agree with Brian, but it M$ Access.  No decent thing there like a 
sequence.
You have to use autonumbers


On 30 Mar 2004, at 22:29, Brian McCallister wrote:

> Don't use auto-increment in an insert where you care about having the 
> identity of the inserted value. A better solution, most of the time, 
> is to use a named sequence and select values off of it, then populate 
> the id field yourself:
>
> In postgresql:
>
> select nextval('MySequence'), nextval('MySequence'), 
> nextval('MySequence'), nextval('MySequence'), nextval('MySequence');
>
> Will give you the next five values from MySequence. Use these for your 
> next five inserts. Most of the time when you set a field to 
> autoincrement, or set a default value, or whatever the database you 
> are using calls it, if you populate that value it doesn't use the 
> default. This allows you to use the default value for batch inserts 
> where you don't care about the ids, and lets you specify the id where 
> you do.
>
> -Brian
>
> On Mar 30, 2004, at 11:31 AM, gounis@osmosis.gr wrote:
>
>> i'm executing an Insert SQL statement using a custom xsp action
>>
>> is it possible to get the new id number (auto increment) inside the 
>> action
>> or inside the my pipeline's match?
>>
>>
>> any idea ?
>>
>> --stavros
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
Met vriendelijke groeten,
Bien à vous,
Kind regards,

Yves Vindevogel
Implements

Mail: yves.vindevogel@implements.be  - Mobile: +32 (478) 80 82 91

Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76
Markt 18c  -  9700 Oudenaarde  -  Tel: +32 (55) 30 55 76

Web: http://www.implements.be

First they ignore you.  Then they laugh at you.  Then they fight you.  
Then you win.
Mahatma Ghandi.

Mime
View raw message