Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2008
    Posts
    131

    Unanswered: calling a file from a .bat file

    Hi all,
    m using db2 v8.1 ESE on windows
    needed to know how we call another file(say abc.sql) from a batch file and how do we capture the output from this abc.sql file in another file.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    db2 -tvf xxxx.sql > output.out
    or option -o xxxx
    see reference for details
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Jul 2008
    Posts
    131
    i dont want to run this xxx.sql file directly from CLP but want to execute it inside another file. giving the above said command in this file throws an error saying 'an unexpected token db2 found'

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    from a bat file you can only call db2 commands with db2 -tvf xxx and not directly. if this has been started from db2 command window
    see db2cmd in reference or previous discussion on bat files
    see : http://www.dbforums.com/showthread.php?t=1615385
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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