Find the answer to your Linux question:
Results 1 to 5 of 5
Dear Folks, My query is i have a.sql , b.sql , c.sql files which needs to be executed using "$ db2 -tvf a.sql"; "$ db2 -tvf b.sql"; "$db2 -tvf c.sql" ...
  1. #1
    Just Joined!
    Join Date
    May 2010
    Posts
    4

    [SOLVED] How to Execute Multiple Sql Files using Scripting

    Dear Folks,

    My query is


    i have a.sql , b.sql , c.sql files which needs to be executed using "$ db2 -tvf a.sql"; "$ db2 -tvf b.sql"; "$db2 -tvf c.sql" , can some one suggest me a script with which i can execute all these sql files in a single shot.

  2. #2
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    717
    for i in *.sql; do db2 -tvf $i; done

  3. #3
    Just Joined!
    Join Date
    Jul 2008
    Posts
    15
    Hi!

    in a shell you can try:
    Code:
    find . -name *.sql -exec db2 -tvf {} \;

  4. #4
    Just Joined!
    Join Date
    May 2010
    Posts
    4
    thanks guys it worked out

  5. #5
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    717
    you're welcome. please mark it as [SOLVED].

Posting Permissions

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