Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: PARAMETER SUBSTITUION ON UPDATE STATEMENT
What is the relationship between table1 and table2?
Igor Neyman, OCP DBA
ineyman_at_perceptron.com
> You can use DBMS_SQL if it will help you.
>
> -----Original Message-----
> Moya
> Sent: 05 April 2002 15:28
> To: Multiple recipients of list ORACLE-L
>
>
> Hi all,
>
> DECLARE
> mfield varchar2(20);
> CURSOR t1 Select region, value from table2;
>
> BEGIN
> FOR t1rec IN t1 LOOP
> mfield := t1rec.region||'_00';
> UPDATE table1
> SET mfield = mfield + 1;
> END LOOP;
> END;
>
> Basically, I would want to update field1 in table1 based on the value of
> region from table2. If region = ABC, I want to concatenate region and _00
to
> determine field to update in table1.
>
> Structure of Table1
> REG_00
> ABC_00
> DES_00
>
> Is this possible?
>
> Moses
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Moses Ngati Moya
> INET: moyam_at_mtn.co.ug
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Alroy Mascranghe
> INET: alroy_at_informatics.lk
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Igor Neyman INET: ineyman_at_perceptron.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Apr 05 2002 - 07:18:26 CST
![]() |
![]() |