Suppose I have a sequence/table:
CREATE SEQUENCE "id_seq" start 5000 increment 1;
CREATE TABLE "users"
(
"id" integer primary key default nextval('id_seq') NOT NULL,
"name" varchar(64)
);
I'm using libpq. If I do something like this:
PGconn *conn; // assume initialized
const char *q = "INSERT INTO users (name) VALUES ('J Doe')";
PGresult *res = PQexec(conn, q);
At this point is there any way for my app to determine the id value of the
newly inserted record?
Mark Thomas
---
thomas@pbegames.com ----> http://www.pbegames.com/~thomas
Play by Electron Games -> http://www.pbegames.com Free Trial Games