]
> [mailto:[EMAIL PROTECTED] Behalf Of Kenneth Gonsalves
> Sent: Wednesday, July 21, 2004 10:46 PM
> To: [EMAIL PROTECTED]
> Subject: [SQL] next integer in serial key
>
>
> hi,
> how does one get the next number in a serial type row?
> --
> regards
> kg
>
>
On Thu, 22 Jul 2004 [EMAIL PROTECTED] wrote:
> > > Alternatively, you can do:
> > > INSERT (accepting the default)
> > > then SELECT currval(the_sequence_object);
> > > then
> > >
> > > NOTE: 2nd method assumes that nobody else called nextval() on the
> > > sequence between when you did the
> >
e-
> From: Kenneth Gonsalves [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 22, 2004 7:52 AM
> To: Oliver Elphick; [EMAIL PROTECTED]
> Cc: Postgresql Sql Group (E-mail)
> Subject: Re: [SQL] next integer in serial key
>
>
> On Thursday 22 July 2004 05:45 pm, Oliver Elp
On Thursday 22 July 2004 05:45 pm, Oliver Elphick wrote:
> On Thu, 2004-07-22 at 12:48, [EMAIL PROTECTED] wrote:
> > Actually it does work, call nextval to get your next value, then call
> > your INSERT statement,
> > explicitly giving said value for the serial column. Then you can
> > proceed wit
On Thursday 22 July 2004 05:18 pm, [EMAIL PROTECTED] wrote:
> Alternatively, you can do:
> INSERT (accepting the default)
> then SELECT currval(the_sequence_object);
> then
did this. barf: foreign key not in original table
--
regards
kg
http://www.onlineindianhotels.net - hotel bookings reser
> > Alternatively, you can do:
> > INSERT (accepting the default)
> > then SELECT currval(the_sequence_object);
> > then
> >
> > NOTE: 2nd method assumes that nobody else called nextval() on the
> > sequence between when you did the
> > insert and when you did the select currval(). Note that
> b
On Thu, 2004-07-22 at 12:48, [EMAIL PROTECTED] wrote:
> Actually it does work, call nextval to get your next value, then call
> your INSERT statement,
> explicitly giving said value for the serial column. Then you can
> proceed with using said value in
> the INSERT statement of the related inserts
TECTED]
> Sent: Thursday, July 22, 2004 12:13 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [SQL] next integer in serial key
>
>
> On Thursday 22 July 2004 10:25 am, you wrote:
> > The same way the default value is defined, which you can
> find by doing:
> > \d tablenam
On Thu, 2004-07-22 at 03:45, Kenneth Gonsalves wrote:
> hi,
> how does one get the next number in a serial type row?
When inserting a new row, do not mention the serial column in the list
of columns, or else give it the value DEFAULT.
--
Oliver Elphick [E
hi,
how does one get the next number in a serial type row?
--
regards
kg
http://www.onlineindianhotels.net - hotel bookings reservations in over 4600
hotels in India
http://www.ootygolfclub.org
---(end of broadcast)---
TIP 7: don't forget to incre
10 matches
Mail list logo