Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    2

    Unanswered: Capture errors from "isql"

    Hi,

    Just wanted to know if there is anyway I can capture errors generated in the SQL batch passed into isql with the "-i" option.

    ie

    If there is an sql batch store in file say test.sql and I pass it as input to isql as

    isql -Uxxxx -itest.sql -Pyyyy

    is there anyway I can figure out (outside the isql using error valriables like $status in UNIX C-shell or ERRORLEVEL in DOS) if all the SQLs in that script file (test.sql) has executed successfully or not

  2. #2
    Join Date
    Oct 2002
    Posts
    369

    Re: Capture errors from "isql"

    RE:
    Hi, Just wanted to know if there is anyway I can capture errors generated in the SQL batch passed into isql with the "-i" option. ie If there is an sql batch store in file say test.sql and I pass it as input to isql as isql -Uxxxx -itest.sql -Pyyyy

    Q1 Is there ANY way I can figure out (outside the isql using error valriables like $status in UNIX C-shell or ERRORLEVEL in DOS) if all the SQL in that script file (test.sql) has executed successfully or not?
    This may not be the desired answer, however the question asked about (ANY) way.

    A1 Yes.

    One approach would require some development; assuming each stored procedure or a batch is designed to return meaningful "result codes"; one could programatically parse the resulting output file to examine each "result code" in the output file e.g.(osql -Uxxxx -itest.sql -Pyyyy -oOutPutFile.out).

  3. #3
    Join Date
    Jan 2003
    Posts
    2
    I tried the "-b" option and that worked too. The %ERRORLEVEL% was able to have a non-0 value in case of errors.

Posting Permissions

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