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

Re: updating current row of cursor resultset in OCI

From: Dave Hau <davehau-no-spam-123_at_no-spam.netscape.net>
Date: Mon, 08 Sep 2003 15:52:24 GMT
Message-ID: <YA17b.11579$Cm6.1364@newssvr27.news.prodigy.com>


Using rowid is not a hack, but is the officially (i.e. Oracle) recommended way of doing positioned updates and deletes, as documented in the OCI manual:

http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96584/oci02bas.htm#423772

or look in OCI Programmer's Guide 9.2 > 2. OCI Programming Basics > Additional Coding Guidelines > Positioned Updates and Deletes.

HTH,
Dave

"Joe" <joeyee1_at_msn.com> wrote in message news:a9aed213.0309080659.cdbe71c_at_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 - 10:52:24 CDT

Original text of this message

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