On Fri, Oct 01, 2004 at 04:05:53PM +1200, [EMAIL PROTECTED] wrote:
> Is your primary key generated automatically?
> If so, the combined insert/query is:
> 
>            String stmt="INSERT INTO SOMEFILE (FLD1,FLD2,FLD3)
> VALUES(?,?,?)";
>            PreparedStatement sql =
> conn.prepareStatement(stmt,Statement.RETURN_GENERATED_KEYS);

        Does mysql actually support this?  I know postgresql does not support
returning generated keys, but I was able to work around it by tacking a
select from the sequence immediately after the insert: e.g.
"insert into foo ... ; select currval('foo_keyfield_seq');"
Is postgres just behind the times?

eric

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to