ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <larry.mead...@gmail.com>
Subject Re: Oracle - INSERT/UPDATE RETURNING INTO
Date Sat, 01 Mar 2008 05:46:46 GMT
How would you do it with JDBC?

Larry


On Fri, Feb 29, 2008 at 8:29 PM, Srini.Gullipalli
<Srini.Gullipalli@gmail.com> wrote:
>
>  How can I achieve this using iBatis.  Not sure if this syntax is ANSI SQL,
>  but Oracle supports this
>
>  UPDATE  aQueueTable SET  LOCK_IN = 'Y'
>  WHERE LOCK_IN='N' and ROWNUM < 2
>  RETURNING keyColumn INTO :key
>
>  Alternate use of this syntax :
>
>  INSERT INTO aTable (sequenceColumn, otherColumns...) VALUES ( aSeq.NEXTVAL,
>  values...) RETURNING sequenceColumn INTO :key
>
>  This syntax eliminates an additional round trip to database ( compared to
>  selectkey )
>
>
>  --
>  View this message in context: http://www.nabble.com/Oracle---INSERT-UPDATE-RETURNING-INTO-tp15772285p15772285.html
>  Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Mime
View raw message