Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> How to Use Cursor variable in Where Statement
I try to update the O_VALUE field in my ORDERS table using cursor
variables, here is what I did:
c_ID VARCHAR2(10);
c_Value NUMBER(3);
Cursor c1 IS SELECT PO_ID, PO_VALUE FROM PRODUCT;
FETCH c1 INTO c_ID, c_Value; EXIT WHEN c1%NOTFOUND; UPDATE ORDERS SET O_VALUE= c_Value WHERE O_ID = c_ID;
The ORDERS table will be updated, but I get wrong values in the O_VALUE
field. It seems like the Where statement is not working. Did I do
something wrong here?
Thank you for your help.
Mike Received on Fri Nov 11 2005 - 07:33:51 CST