Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Posts
    16

    Unanswered: running sql files on solaris

    Hi,

    I want to know how to run sql files in command prompt for db2 on Solaris, something similar to @abc.sql in Oracle.

    I'm new to Db2, please bear with me if this is a silly question.

    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    db2 -tf filename.sql

    Assumes that statements are separated with semicolons (";")

  3. #3
    Join Date
    Mar 2003
    Location
    Sacramento, California
    Posts
    14
    Quote Originally Posted by yadu
    Hi,

    I want to know how to run sql files in command prompt for db2 on Solaris, something similar to @abc.sql in Oracle.

    I'm new to Db2, please bear with me if this is a silly question.

    Thanks
    Unfortunately, you can't run a script from within the db2 clp like you can in oracle (i.e @<script>). The only way to run a script is by calling the db2 clp from the OS prompt. For example, I use;

    db2 -tvf <scriptname> -z <outputfile>

    -t denotes the semicolon as the statement terminator (what you'll be used to in Oracle). -v is verbose, and -f is for filename. -z sends the output to a specified file (instead of "spooling" you can do this).

    Kedison

  4. #4
    Join Date
    Oct 2005
    Posts
    16
    Thanks for all your replies.

    It has been of much help.

    I dont know why IBM Db2 information pages clearly mention about this.

    Before posting, I searched for around 2 hours in all IBM information pages, but I could not get what I was looking for.

    Again thanks for your replies.

Posting Permissions

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