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


> ----------
> From:         Federico Vesco[SMTP:[EMAIL PROTECTED]]
> Reply 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
> 
> need to obtain this value because i have to return the primary key value)
> ? 
> I thougth I migth obtain it with a simple select query, but in this way
> i'm 
> not sure the value I obtain is exactly the one needed (by definition, only
> 
> the primary key identifies univokely a record).
> Any suggestion? How can i manage this situation? Do you think I have do 
> change my program?
> 
> 

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to