If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2 scripts related

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-12-06, 05:24
nikhincm nikhincm is offline
Registered User
 
Join Date: Sep 2006
Posts: 5
Angry db2 scripts related

hi

i want to run db2 scripts from commnad , i have given db2 -tvf filename.sql..
this is working fine .but i want to run so many scrpts at a time,in oracle i have seen that one script file they are mentioning others as @filename.sql,
but in db2 that is not possible is there any way to run scripts like that

eg.i have Applicatio.sql

i have to run other five scripts

is there any way to include these scripts in application.sql so that all scripts will run.
Reply With Quote
  #2 (permalink)  
Old 09-12-06, 06:41
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
if i have understood ur problem properly,
then it can be easily acheived using batch files

Run_Patch.bat.....................................
@echo on
db2cmd .\SemiAuto_Patch.bat

SemiAuto_Patch.bat..............................
echo connection to DB RAHUL
db2 connect to <DB_NAME> user <>
echo dropping procedures, functions, triggers etc
db2 -tvf <Folder_Name>1_Drops.txt > <Folder_Name>1_Drops.log
echo running main SQL
db2 -tvf <Folder_Name>2_Main.txt > <Folder_Name>2_Main.log
echo creating procedures, functions, triggers
call .\3_db2_e1.bat > .\3_db2_e1.log
echo giving grants
db2 -tvf <Folder_Name>4_Grant.txt > <Folder_Name>4_Grant.log
echo doing verifications
pause
exit

--Rahul Singh
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On