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

Home -> Community -> Usenet -> c.d.o.server -> UPDATE the column (Parametrization)

UPDATE the column (Parametrization)

From: DAVID <david_nat2000_at_yahoo.com>
Date: 3 Feb 2004 22:43:36 -0800
Message-ID: <db8bd827.0402032243.3fa3d973@posting.google.com>


Hi Every one,

With regards to my previous query I would like to say that now I am using the following &#8220;Update code&#8221; in order to update the
&#8220;Target_parameter&#8221; column of Parameters table:

Table_Structure:

SQL> Create table Parameters(Parameter_ID number,Description varchar2(50), Source_Parameter varchar2(400),Target_Parameter varchar2(400));

Insert Statement:

SQL> 'insert into parameters(Parameter_ID,Description,Source_Parameter, Target_Parameter)
select 19,''DataFile Paths'',file_name,null from dba_data_

Update Code:

accept trg_prm1 prompt 'Enter the name of DataFile of the Source Parameter Column: '
accept trg_prm2 prompt 'Enter the name of DataFile for the Target Parameter Column: '

declare

b varchar2(20);

begin

select count(*) into b from parameters where description='DataFile Paths';

For i in 1..b
loop

update parameters set TARGET_PARAMETER = '&&trg_prm2' where Source_Parameter = '&&trg_prm1';

end loop;

end;

/

 The above code works, but I run it every time in order to update the
&#8220;target_parameter&#8221; column with datafiles.
Is there a way or what changes I should do in the update code that at a single time I updated all the datafiles in the
&#8220;target_parameter&#8221; column.

Any suggestion will be appreciated.

Thanks

David Received on Wed Feb 04 2004 - 00:43:36 CST

Original text of this message

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