Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8145057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:32:47+00:00 2026-06-06T13:32:47+00:00

I have some scripts that get run often, always from within a connected SQLPlus

  • 0

I have some scripts that get run often, always from within a connected SQLPlus session.

I need a way to exit the script when an error occurs, without disconnecting or exiting SQLPlus itself. 100% of the time, when an error occurs, the connected DBA will need to issue one or more commands into the session. 100% of the time, when an error occurs, there are other SQLPlus statements (and thus must be outside of a BEGIN..END;) later on in the script that must not be executed or serious problems could arise.

NOTE: If you suggest WHENEVER SQLERROR EXIT then you didn’t read the above text. That will disconnect and exit SQLPlus in addition to the script, which is not acceptable behavior.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:32:49+00:00Added an answer on June 6, 2026 at 1:32 pm

    I’ve found an interesting idea here which, when combined with spencer7593‘s answer, will get me selective sub-script calling, to which I can pass the PL/SQL output values. To wit:

    VAR continue number;
    EXEC :continue := 1;
    BEGIN
       SELECT some_bool_test() INTO :continue FROM dual;
    END;
    
    SET termout OFF
    COLUMN script_name NEW_VALUE v_script_name
    SELECT decode(:continue, 1, 'run_stuff.sql', 'skip.sql') script_name FROM dual;
    SET termout ON
    
    @&v_script_name :some_other_values
    

    Where skip.sql is an empty text file.

     

    UPDATE: I’ve moved most of this into a RUN.SQL file, where I pass in the boolean (0 or 1) as &1, the script name to call on success as &2, and then any other expected parameters to pass to the called script. Thus, it ends up looking something like this:

    VAR continue number;
    EXEC :continue := 1;
    BEGIN
       SELECT some_bool_test() INTO :continue FROM dual;
    END;
    
    @run.sql :continue 'run_stuff.sql' :some_other_values
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some scripts that we run as part of our unit tests. This
I have cobbled together some scripts from various internet sources to get a form
I have some scripts that are supposed to be executable. But after it is
I have a C++ app that uses Python to load some scripts. It calls
Simple question, what are some good free mobile device detection scripts that people have
We have a system that has some Bash scripts running besides Java code. Since
i have a script that does a lot of processing on some rows from
I have some trouble with python. I am trying to get output from a
We have a few C++ solutions and we run some build scripts using batch
I have written some python scripts that take advantage of pysvn to analyze a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.