Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: PARAMETER SUBSTITUION ON UPDATE STATEMENT

RE: PARAMETER SUBSTITUION ON UPDATE STATEMENT

From: Alroy Mascranghe <alroy_at_informatics.lk>
Date: Fri, 05 Apr 2002 03:23:23 -0800
Message-ID: <F001.0043C834.20020405032323@fatcity.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). Received on Fri Apr 05 2002 - 05:23:23 CST

Original text of this message

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