pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedLast serial number inserted
2+ messages / 2 participants
[nested] [flat]
* Last serial number inserted
@ 2000-10-17 10:16 Eduardo <eduardo@complex.com.br>
2000-10-17 15:47 ` Re: Last serial number inserted Josh Berkus <josh@agliodbs.com>
0 siblings, 1 reply; 2+ messages in thread
From: Eduardo @ 2000-10-17 10:16 UTC (permalink / raw)
To: pgsql-sql
How can I get the last id ( serial number ) inserted. My C code is :
res = PQexec(conn,"insert into table1 (field1) values ('value1')");
table1:
id SERIAL,
field1 VARCHAR(10)
Thanks
Eduardo K
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Last serial number inserted
2000-10-17 10:16 Last serial number inserted Eduardo <eduardo@complex.com.br>
@ 2000-10-17 15:47 ` Josh Berkus <josh@agliodbs.com>
0 siblings, 0 replies; 2+ messages in thread
From: Josh Berkus @ 2000-10-17 15:47 UTC (permalink / raw)
To: pgsql-sql
Eduardo,
Use the curval(serial) function. For more information, look in the
online docs under the name of that function. nextval(), curval() are
wonderful things!
-Josh Berkus
--
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 436-9166
for law firms, small businesses fax 436-0137
and non-profit organizations. pager 338-4078
San Francisco
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2000-10-17 15:47 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-10-17 10:16 Last serial number inserted Eduardo <eduardo@complex.com.br>
2000-10-17 15:47 ` Josh Berkus <josh@agliodbs.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox