Re: Q: Trying to update a table using ROWID

From: <james.lawrence_at_EPAMAIL.EPA.GOV>
Date: 1995/06/20
Message-ID: <james.lawrence.66.000F5CC6_at_EPAMAIL.EPA.GOV>#1/1


In article <DA4KLr.H9C_at_cix.compulink.co.uk> cwg_at_cix.compulink.co.uk ("Chun Wong") writes:
>From: cwg_at_cix.compulink.co.uk ("Chun Wong")
>Subject: Q: Trying to update a table using ROWID
>Date: Tue, 13 Jun 1995 18:56:15 GMT
 

>I'm trying to update a table using the ROWID of the table which I get
>from a cursor in ProC, something like;
 

> EXEC SQL DECLARE a_cursor CURSOR FOR
> SELECT t1.field1, t2.flag, t3.name, t1.rowid
> FROM table1 t1, table2 t2, table3 t3
> WHERE t1.code = t2.code AND
> t2.code = t3.code;
>
> OPEN...
 
> while(1)
> {
> FETCH...
>
> do C processing...
>
> EXEC SQL UPDATE table1
> SET...
> WHERE rowid = :row_id;
> }
>
> CLOSE ...
>
>Trouble is, I seem to get an invalid ROWID error when I try to update.
>Is this because my cursor is selecting from more than one table?
 

>Looking at the rowid in C appears to be correct as I've declared :row_id
>as a char which the manual says is the equivalent to VARCHAR2.
 

>Any help would be appreciated. Many thanks.
 

>Chun.

Check out CHARTOROWID in your SQL reference manual. I suspect that's your prob.

Lawrence.... Received on Tue Jun 20 1995 - 00:00:00 CEST

Original text of this message