Results 1 to 4 of 4

Thread: stop script

  1. #1
    Join Date
    Jan 2003
    Location
    The Netherlands
    Posts
    149

    Angry Unanswered: stop script

    Hello does anyone know how to stop a script?
    I'm doing something like:
    sqlplusw "sys/s@ultimodm.ishbv.nl as sysdba" @c:\standard\sql\check.sql
    in this sql-file I want to stop the script at a certain place. Does anyone know how to do this?

    greetings

    Coen DUnnink
    The Netherlands

  2. #2
    Join Date
    Apr 2004
    Posts
    246
    Oldest trick in the book - use whenever sqlerror and force an error:
    whenever sqlerror exit 4
    column stop_Err newvalue stop_err

    lots of code...
    select 'xxx' stop_err from some_table where some_error_condition_is_bad;

    select * from dual&stop_err;

    more code here

  3. #3
    Join Date
    Jan 2003
    Location
    The Netherlands
    Posts
    149

    Arrow Not clear

    your answer is not clear to me. what are the variables and what is the comment and what are hard coded values in your reply?

  4. #4
    Join Date
    Apr 2004
    Posts
    246
    - the opening line is my comment, up to the colon.
    - where it says lots of code, is where you would put lots of code
    - more code here is where you can put more code
    - some_table is some table - I don't know your system, you pick a table. Use dual, I don't care.
    - where it says some_error_condition_is_bad, put some logic to test for a bad error condition. I don't know what you consider a reason to stop, and I don't care.
    - if you don't know about whenever, column, new_value (I typed that one wrong in the original, it's new_value, not newvalue), or the use of the &, then try reading the books.

Posting Permissions

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