A long time ago, in a galaxy far, far away, Federico Vesco wrote:
> How may i obtain the value of the primary key generated by PostgreSQL ( i
> need to obtain this value because i have to return the primary key value)
?
Searching for a solution to the same problem, I came across the following in
You should get the PRIMARY KEY before inserting the row.
Create a new method called getNewId() (or something like this...)
Use the following query to get the id:
"SELECT nextval('project_idproject_seq')"
the result of this will be your desired PK.
All you have to do now is to use this value in
chael [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 26, 2001 3:50 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: [JBoss-user] Auto Incrementing Primary Key with PostgreSQL
> and JBoss
>
>
>
> I don't use Postgres but on MS SQL Server, I call "
RE: [JBoss-user] Auto Incrementing Primary Key with PostgreSQL
and JBoss
I don't use Postgres but on MS SQL Server, I call "SELECT
@@IDENTITY" immediately after the insert statement. Perhaps this will
lead
you in the right direction.
---
Michael R. Maraya
> ---
To: [EMAIL PROTECTED]
> Sent: Thursday, July 26, 2001 11:06 AM
> To: [EMAIL PROTECTED]
> Subject: [JBoss-user] Auto Incrementing Primary Key with PostgreSQL
> and JBoss
>
>
> How may i obtain the value of the primary key generated by PostgreSQL ( i
>
Hi!
I have the following problem.
I create the following table (with PostgreSQL) :
CREATE TABLE "project" (
"idproject" SERIAL,
"projectName" varchar(64),
"budget" int4,
"start" date,
"end" date,
CONSTRAINT "project_pkey" PRIMARY KEY ("idproject")
);
In this way the primary k