Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Get the RowID of the last insert

Re: Get the RowID of the last insert

From: Serge Rielau <srielau_at_ca.ibm.com>
Date: Mon, 26 Mar 2007 08:31:18 -0400
Message-ID: <56psonF28dq67U1@mid.individual.net>


Sam Hwang wrote:
> Is it RETURNING clause a proprietary statement of Oracle? If so, how
> to achieve the same effect in MySql or Sql Server?
>

SQL Server 2005 has a similar clause with different syntax, but the target must be a temp table. mySQL I do not know. If you try to write portable code I would refrain from ROWID all together. The whole concept is not covered by the SQL standard and each vendor has different semantics. Also you may or may not see the performance you expect.
Especially the duration within which you can rely on ROWID to pin your row is undefined.

Cheers
Serge

PS: I wasn't aware SQL Server has ROWID (?)

-- 
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Received on Mon Mar 26 2007 - 07:31:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US