Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006
    Posts
    5

    Angry Unanswered: 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.

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •