In response to JORGE MALDONADO :
> How do I use the functions to get data from sequence objects?
> For example, I need to know what is the value of a serial field after inserting
> a new record; the one assigned to the record just inserted.
> I have tried the psql interfase with the following:
> select currval('restaurant.ordenes_clave_seq');
> but I get a message telling me that "currval of sequence "ordenes_clave_seq" is
> not yet defined in this session.
You have to use nextval() first, without nextval() the current value of
the sequence are undefined in this session.
In other words: first insert your new row into the table, after that
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99
In response to
- corrupt db at 2009-11-03 18:00:32 from Lars Gustafsson
pgsql-novice by date
|Next:||From: Michael Lush||Date: 2009-11-03 17:04:49|
|Subject: Determining database status|
|Previous:||From: Brian Modra||Date: 2009-11-03 06:15:36|
|Subject: Re: GETTING INFO FROM SEQUENCE OBJECTS|