Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

oracle batch/scripts

Status
Not open for further replies.

Nordyck

Programmer
Aug 16, 2001
57
0
0
US
I'm attempting to build update.sql file that updates several tables with the same values. Update file is executed from a batch file.

file: update.sql
------------------
dte date := systimestamp;
st varchar2 := "test";
/
update tbl1
set Source=st,
ProcessDate=dte
where ProcessDate is null;
/
update tbl2
set Source=st,
ProcessDate=dte
where ProcessDate is null;
/
update tbl3
set Source=st,
ProcessDate=dte
where ProcessDate is null;

test.bat file:
-----------------
sqlPlus user/pw @Update.sql

Thanks in advance.

nordycki@hotmail.com
 
Nearly, you fell between the sqlplus and pl/sql stools

declare
dte date := systimestamp;
st varchar2(4) := "test";
begin

update tbl1
set Source=st,
ProcessDate=dte
where ProcessDate is null;
update tbl2
set Source=st,
ProcessDate=dte
where ProcessDate is null;
update tbl3
set Source=st,
ProcessDate=dte
where ProcessDate is null;
end;
/
exit



In order to understand recursion, you must first understand recursion.
 
thanks, that worked great.

nordycki@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top