Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> UPDATE the column (Parametrization)
Hi Every one,
With regards to my previous query I would like to say that now I am
using the following “Update code” in order to update the
“Target_parameter” 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
“target_parameter” 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
“target_parameter” column.
Any suggestion will be appreciated.
Thanks
David Received on Wed Feb 04 2004 - 00:43:36 CST