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 -> updating current row of cursor resultset in OCI

updating current row of cursor resultset in OCI

From: Joe <joeyee1_at_msn.com>
Date: 8 Sep 2003 07:59:43 -0700
Message-ID: <a9aed213.0309080659.cdbe71c@posting.google.com>


I'm using Oracle9i and converting some existing applications from Sybase, which allows for update of current row in the result set with its ct_cursor function call. I've looked through the Oracle documentation, the news groups in Google and asktom.oracle.com and haven't found an example in OCI of how to do something like this:

Some sample C code that uses OCI to create a cursors using the "OPEN C1 FOR SELECT ... FOR UPDATE", and later uses the cursor (C1) to update the row via the "UPDATE ... SET .... WHERE CURRENT OF C1" statement.

I saw that this question was posed before on many occasions, and there were basically 2 types of response (1) No response (2) Use rowid as part of the "SELECT ... FOR UPDATE". This second option, although seems to work, also appears to be a hack. It looks like a hack because (a) I saw a bunch of postings and in asktom.oracle.com that the rowid may change depending on the type of data changes (b) updating current row of cursor result set is supposed to be in the SQL standard and I can do it in PL/SQL, why do I need to play around with rowid, which is an internal feature of the Oracle database.

Any definitive answer to this question would be of great help as I'm a newbie at this Oracle programming stuff. I also created a "TAR" in metalink.oracle.com about a week ago, but haven't got any response yet. I just need some guidance on the proper way to do this, if there is one. Thanks. Received on Mon Sep 08 2003 - 09:59:43 CDT

Original text of this message

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