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

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

PARAMETER SUBSTITUION ON UPDATE STATEMENT

From: Moses Ngati Moya <moyam_at_mtn.co.ug>
Date: Fri, 05 Apr 2002 01:28:20 -0800
Message-ID: <F001.0043C70A.20020405012820@fatcity.com>


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). Received on Fri Apr 05 2002 - 03:28:20 CST

Original text of this message

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