Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    5

    Question Unanswered: submitting .sql files or equivalent of @

    I know that in db2 from the command prompt one can say db2 -tf filename.sql to submit a sql script. I have to rewrite some Oracle scripts for db2 and want to know if the only way out is to explicitly put the db2 and command line options each time i submit a file

    How does one submit a file from say within a db2 prompt? i.e. is there an equivalent of the "@" that we use in sqlplus or sql scripts to submit other .sql files ? Also if such a method exists can we still pass instructions/options like suppressing header and spooling data to a file.


    Thanks in advance for any suggestions.
    Ranjith

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: submitting .sql files or equivalent of @

    Originally posted by ranjithm
    I know that in db2 from the command prompt one can say db2 -tf filename.sql to submit a sql script. I have to rewrite some Oracle scripts for db2 and want to know if the only way out is to explicitly put the db2 and command line options each time i submit a file

    How does one submit a file from say within a db2 prompt? i.e. is there an equivalent of the "@" that we use in sqlplus or sql scripts to submit other .sql files ? Also if such a method exists can we still pass instructions/options like suppressing header and spooling data to a file.


    Thanks in advance for any suggestions.
    Ranjith
    The only place you can specify a sql script file name is on the db2 command line. There's no equivalent of Oracle's '@' command.

    You can control other command line parameters by issuing UPDATE COMMAND OPTIONS USING ... command from within the sql script.

Posting Permissions

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