Whenever sqlerror exit failure - what value is failure ?

I have a sql*plus script file that is run from a batch file on windows. The script file starts with whenever sqlerror exit failure; But what error value is returned for failure on windows ?
SQL*Plus documentation simply says it's "operating-system dependent values", but I can't find any other documentation saying what these values are!
By trial & error it seems to return 1 on windows, so sets the ERRORLEVEL to 1 within the batch file.
But are the values that SQL*Plus will return actually documented anywhere ?

I don't remember ever seeing them documented, but they are the standard error codes for whatever OS you're using. At one time, windows help listed the error codes: 0=good, 1=failure, 2=warning; but I can't find that anymore either. and since the values are different by OS, another option is to exit with a specific value
whenever sqlerror exit 4
then you script becomes more portable, and you don't need to worry about changing errorcodes.

Similar Messages

  • Whenever sqlerror exit failure rollback in IDE's

    Hi all,
    Sorry to cross-post, but there is a tendancy for people who have a bunch of Expertise in SQL/PL/SQL to not check other forums all that often so I am hoping for more results here.
    I've started a thread over here:
    deployment scripts with "exit failure rollback"
    The basic problem is that when I have a SQLplus script with
    whenever sqlerror exit failure rollbackBut when this is executed through an IDE like toad or SQL developer the IDE appears to ignore the exit command and continues executing the script regardless of any errors.
    Has anyone encountered this problem previously and have a solution? or must I beat my deployment manager over the head to convince him to always use SQLPlus for database deployments?

    WhiteHat wrote:
    Hi all,
    Sorry to cross-post, but there is a tendancy for people who have a bunch of Expertise in SQL/PL/SQL to not check other forums all that often so I am hoping for more results here.
    I've started a thread over here:
    deployment scripts with "exit failure rollback"
    The basic problem is that when I have a SQLplus script with
    whenever sqlerror exit failure rollbackBut when this is executed through an IDE like toad or SQL developer the IDE appears to ignore the exit command and continues executing the script regardless of any errors.
    Has anyone encountered this problem previously and have a solution? or must I beat my deployment manager over the head to convince him to always use SQLPlus for database deployments?"WHENEVER" is sqlplus (only) syntax.
    Either only code to work with any/every client or only use sqlplus

  • How to use the WHENEVER SQLERROR EXIT statement in a PL/SQL block.

    Hi,
    I am getting the following error when trying to add the following statement in an PL/SQL block.
    WHENEVER SQLERROR EXIT SQL.SQLCODE
    [exec] ERROR at line 23:
    [exec] ORA-06550: line 23, column 12:
    [exec] PLS-00103: Encountered the symbol "SQLERROR" when expecting one of the
    [exec] following:
    [exec] := . ( @ % ;
    How can i use the above statement in the PL/SQL Block? I have only IF statement in that block( between BEGIN and END).
    Thanks

    Hi,
    Usually there's always more than one solution.
    Can you post an example of what you're trying to accomplish?
    That would be useful.
    (Place the tag before and after your example to maintain formatting en spacing, see the [fac|http://forums.oracle.com/forums/help.jspa] regarding available tags)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • WHENEVER SQLERROR EXIT SQL.SQLCODE||SQLERRM  & Relate ORA-ERRNO & SQLCODE

    Hi,
    Is there any way to pass both the SQL.SQLCODE & SQLERRM to the os back ??
    When I tried WHENEVER SQLERROR EXIT SQL.SQLCODE
    The actual oracle error code (ORA-00942) and the error code (174 ) returned by SQL.SQLCODE are different . So how can I get the info. that is related to SQL.SQLCODE
    eg :
    For this test program
    rm -f /home/etladm/test/test.log
    sqlplus -S <<EOF >> /home/etladm/test/test.log
    ranjeeshk/ics
    set verify on time on timing on term on echo on feedback on serveroutput on
    WHENEVER SQLERROR EXIT SQL.SQLCODE
    -- WHENEVER SQLERROR EXIT SQLERRM
    select sysdate sdate from dua;
    exit 1
    EOF
    echo "Number of rows are: $?" >> /home/etladm/test/test.log
    echo " -------- Log file -------- \n"
    cat /home/etladm/test/test.log
    The output was
    etladm@stdwdev2:/home/etladm/test>. ./test.ksh
    -------- Log file --------
    select sysdate sdate from dua
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Number of rows are: 174
    etladm@stdwdev2:/home/etladm/test>
    So how can I link ORA-00942 and SQLCODE 174 ?
    with thanks in advance
    Ranjeesh K R

    From the Oracle documentation:
    <quote>
    The range of operating system return codes is also restricted on some operating systems. This limits the portability of EXIT n and EXIT variable between platforms. For example, on UNIX there is only one byte of storage for return codes; therefore, the range for return codes is limited to zero to 255.
    </quote>

  • WHENEVER SQLERROR Problem

    Below is my sql saved as testing.sql
    SET PAGESIZE 0
    WHENEVER SQLERROR EXIT SQL.SQLCODE;
    WHENEVER OSERROR EXIT SQL.OSCODE;
    SPOOL /u021/idaho/load_scripts/ebiz_ctgry_prodfam/build_ebiz_ctgry_prodfam_1.og
    select
    productid,
    categoryid,
    sequence,
    inherit
    from site.categoryproduct@TO_EBIZ_DBLINK1
    SPOOL OFF
    exit
    The issue is that code is working as expected on AIX but not on SUN Solaris, here the DBLINK used is invalid one and the select should fail.
    AIX Server output:*
    sqlplus -s userid/password @testing.sql
    from site.categoryproduct@TO_EBIZ_DBLINK1
    ERROR at line 13:
    ORA-02019: connection description for remote database not found
    113620 spss7a04:/u021/idaho/load_scripts/ebiz_ctgry_prodfam> echo $?
    *227*
    Solarix Server output:*
    from site.categoryproduct@TO_EBIZ_DBLINK1
    ERROR at line 13:
    ORA-02019: connection description for remote database not found
    4143 v08k44:/u021/idaho/load_scripts/ebiz_ctgry_prodfam> echo $?
    *0*
    The question is why in solaris $? returning 0. I have also tried WHENEVER SQLERROR EXIT FAILURE ; option but even that is not working. Also any help in fixing this would be appreciated.

    It doesn't have to be 'EOF', it can be any token (I know that doesn't help you here).
    I don't know if there's any other option for you here, I've always found it good practice to use a terminating token regardless of the particular shell. It seems you are going to have to make a change to get this to port properly in any case, so you may have no choice, however laborious that might be.
    Edit you may be better asking this question in a shell scripting forum, for example: [http://www.unix.com/shell-programming-scripting/], and in which case you can close this one off.

  • WHENEVER SQLERROR does not work for remote db?

    Hi,
    I've encountered a problem that an error on a remote db (called via db link) does not force SQL*PLUS to exit and report the error.
    Local machine: Sun Solaris
    Local db: 8.1.7.2
    Remote machine: Windows NT, 2000 or XP (I don't know).
    Remote db: 9.2.0.5
    Call to SQL*PLUS: sqlplus /NOLOG @$BASE_DIR/tools/bin/xxx.sql
    Relevant piece of code in xxx.sql:
    connect cemis/cemis@loc9280
    whenever sqlerror exit SQL.SQLCODE
    set heading off
    set trimspool on
    SET PAGES 0
    SET LINESI 250
    SET ECHO OFF
    SET VERIFY OFF
    set termout off
    set feedb off
    set recsep off
    rem *** Do the work ***
    whenever sqlerror exit SQL.SQLCODE
    rem Get rid of old data
    TRUNCATE TABLE local_table;
    rem fill table via db-link
    INSERT INTO local_table
    col1,
    col2
    SELECT
    rem_col1,
    rem_col2
    FROM rem_user.rem_table@dbl_name
    COMMIT;
    spool file.csv
    SELECT 'Spalte1' || chr(9) || 'Spalte2'
    FROM dual;
    SELECT col1, col2 FROM local_table;
    spool off
    exit 0
    In our environment the script runs through without any error. After execution the file.csv is not there. No errors in the log file.
    I tried to select data from the remote db manually and ran into this:
    'ORA-01017: invalid username/password; logon denied' followed by
    'ORA-02063: preceding line from dbl_name'.
    Do you have any idea why this error does not cause sql*plus to exit?
    Does the WHENEVER... only work properly with local errors?
    I would be grateful for any information regarding this.
    Regards,
    Guido

    I believe this is a limitation in SP3, but tell me, are you running with a simple producer or a complex producer?

  • WHENEVER SQLERROR question

    I want a script to exit when it executes successfully and to stop when there is a error, so instead of WHENEVER SQLERROR EXIT, I want something like WHENEVER SQLERROR CONTINUE, ELSE EXIT.
    How can it be done?

    "whenever sqlerror continue" does exist and works.
    If you want to exit after the whole script is done, just add "exit"
    as the last line.
    Exiting after one successfull statement when others are following is not possible.

  • WHENEVER SQLERROR and 11.2.0.2.0 client

    Hi,
    Facing one issue which am not to understand further.
    One of the file say 'config.tmp' has a variable defined as follows:
    define termout = 'on';
    define SQLErrorHandling = 'continue none';In another sql file say 'myfile.sql' I read the above file as @config.tmp and then try to fetch the variable value as follows:
    @config.tmp
    execute DBMS_OUTPUT.PUT_LINE('&SQLErrorHandling');
    whenever sqlerror &SQLErrorHandling;
    set termout &termout;But am getting following error
    SQL> @myfile;
    continue none
    Usage: WHENEVER SQLERROR
         { CONTINUE  [ COMMIT | ROLLBACK | NONE ]
         | EXIT  [ SUCCESS | FAILURE | WARNING | n | <variable> | :<bindvariable> ]
                 [ COMMIT | ROLLBACK ] }
    SQL>Looks like it fails to replace the variable '&SQLErrorHandling' value. However value of '&termout' variable gets fetched.
    This issue is not seen when 11.1.0.6.0 client is used. Only when the client version is 11.2.0.2.0 am facing this issue.
    Any suggestions?
    Regards,
    Neuron
    p.s.: earlier asked this question under PL/SQL section but no helpful responses.

    Thanks guys for your replies, please find my comments so far.
    I don't understand why you have a call to execute DBMS_OUTPUT ... this is not the place for it. Write to a log file or echo to the terminal window.Thanks 'damorgan', however DBMS_OUTPUT was added from debugging perspective, to check if the value is being fetched or not. Btw that's not the intent of my post and business logic too, what am trying to figure out is why if throws 'Usage: WHENEVER SQLERROR' error only when am connected with 11.2.0.2.0 client. If you help to provide some pointers here, that will be really great.
    if you GOOGLE "SQLErrorHandling" you get a number of hits for TSQL & none for Oracle.Thanks 'SB' but sorry I did not understand your comments. Not sure why you want to GOOGLE 'SQLErrorHandling' but you can check this [url http://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12052.htm]link.
    Any suggestions for usage errors?
    Regards,
    Neuron
    Edited by: Neuron on Jan 24, 2013 12:30 PM
    Edited by: Neuron on Jan 24, 2013 12:34 PM

  • How come the latest version of firefox (4.0) lost the feature of saving the bookmarks whenever I exit the browser? Now the only option is actually closing all the bookmarks and manually opening them again.

    With previous versions of Firefox, I was always asked this question whenever I exit the web browser and turning my laptop off: Do you want to save your bookmarks?... At least that was the message of the question. Right now, my only option is actually closing all the bookmarks and manually opening each one of them or starting from a saved bookmark list.
    Thanks!

    One change in Firefox 4 is to by default stop Firefox displaying the warning message, but it can be turned back on by changing some preferences.
    # Type '''about:config''' into the location bar and press enter
    # Accept the warning message that appears, you will be taken to a list of preferences
    # Locate the preference '''browser.tabs.warnOnClose''', if its value is set to '''false''', double-click on it to change its value to '''true'''
    # Repeat this for these 3 preferences '''browser.warnOnQuit''', '''browser.warnOnRestart''' and '''browser.showQuitWarning'''

  • Problems with WHENEVER SQLERROR

    I'm creating a PRO C application, and I'm having problems with the use of WHENEVER SQLERROR DO <function>.
    I've got this function: void mensajeDeError(int error); defined in a static library, and compiles perfectly, but when I try to call it from a program, I get this warning message:
    warning: improper pointer/integer combination: arg #1
    I've checked the call to the function a lot of times, but I haven't got any solution, because it's right.
    I've realized, that this funcion (if you put in into a structure of WHENEVER SQLERROR DO), only works if you pass a char* as a parameter too, but not with the rest of stardard types of variables (f.e. ints, floats, etc.,)
    I hope you give me a solution.
    Thank you.
    Juan Carlos.

    EXEC SQL WHENEVER SQLERROR DO sql_error();
    void sql_error()
    char msg[512];
    size_t buf_len, msg_len;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    buf_len = sizeof(msg);
    sqlglm(msg, &buf_len, &msg_len);
    printf("\nOracle error detected:");
    printf("\n%.*s \n", msg_len, msg);
    EXEC SQL ROLLBACK WORK RELEASE;
    exit(1);
    }Hope this help.
    Thomas Devalli.
    KSI Int'l
    [mailto][email protected][mailto]
    www.ksi.be
    null

  • Since reinstalling itunes i can no longer sync. Error message says already synced with another itunes library. I get a blank sync - no songs, photos ect as it comes up with this error whenever try to select what is to be synced. Help - lost everything

    Since reinstalling itunes i can no longer sync. Error message says already synced with another itunes library. I get a blank sync - no songs, photos ect as it comes up with this error whenever try to select what is to be synced. Help - lost everything. Complete nightmare - Apple sort a fix NOW, but will take any help

    Plawexki wrote:
    ...  do you know if the contacts, photos, messages etc will be wiped?
    Yes... Everything will be Wiped and Replaced with what is currently on Your Mac.
    SYNCING with iTunes
    See here  >  http://support.apple.com/kb/HT1386
    From Here  >  http://www.apple.com/support/iphone/syncing/
    You may find this information of interest...
    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • What values are stored in the alignment region of an image and how can they be set?

    I am calling a number of C++ functions with different variable sized LabView images at rates in excess of 20 images per second. I need to tell the C++ code developer what values to expect in the alignment region of the image. Right now I am creating an image with a zero border that is 32 byte aligned, so there is no alignment region and everything works fine.
    I would like to move to using normal LabView images, as it saves sereval steps and allows me to use a combination of LabView and C++ operations. I do not want to re-write all the C++ functions to be aware of the LabView alignment and border areas. I just want the alignment area and border area to be zero and process them like they were part of the image.
    I can set the border region to zero using Fill Image but I am not clear as to what the values will be in the alignment region, or if I can set them. Does Fill Image also fill the alignment region? Since the C++ code is being developed on a system without LabView, and I do not have the means to debug it on my LabView system, it is tricky to know what is in this region.
    In the ideal world, I would like it to be zero or to be able to set it to zero.
    Thanks in advance.
    Andrew

    Hi Andrew,
    The function IMAQ Fill Image allows you to set the border and all or part of your image to a certain pixel value that you define. One of the inputs to Fill Image is "Image Mask" which you can use to specify which pixels in your original image will be modified. This help document describes the Fill Image VI in detail and can provide some good information for you.
    Essentially, the locations of any non-zero pixels in your Image Mask are where the new pixel value will be set in your original Image. Does that make sense? So if you know where your alignment region is then you can use an image mask with Fill Image to set the alignment region and the border to zero. If you don't use an Image Mask, the Fill Image VI will assign the new pixel value to the entire original image. 
    Regards,
    Daniel H.
    Customer Education Product Support Engineer
    National Instruments
    Certified LabVIEW Developer

  • What values to place in signer.properties file for Webutil configuration

    Hi. I'm not sure of what value to place in JDK_HOME in signer.properties for Webutil configuration. My current settings are:
    JDK_HOME=D:\ora9i\jdk
    JINIT_HOME=C:\Archivos de programa\Oracle\JInitiator 1.3.1.13
    #Certificate settings:
    # These are used to generate the initial signing certificate
    # Change them to suite your organisation
    DN_CN=Product Management
    DN_OU=Development Tools
    DN_O=Oracle
    DN_C=US
    JAR_KEY=webutil
    JAR_KEY_PASSWORD=webutil
    Is JDK_HOME the jdk for oracle or SDK for windows machine(how to find?)?. Also how do i repeat the process of makecert and signing of webutil.jar and jacob.jar?. If i try to repeat this process I get the following warnings or error?
    Makecert:
    keytool error: java.lang.Exception: Key pair not generated, alias <webutil> already exists
    Certificate created...

    JDK_HOME is just the location of a Java distribution with Keytool in it - have a look at the signer batch file and you'll see how each variable is used. Also if you run keytool from the command prompt it will show you the commands to delete and existing Key or list the keys that are currently stored.

  • Mapping of source message to IDOC.. What values should be assigned?

    Hi guys, again
    I have SOAP->XI->IDoc scenario, but my IDocs arrive only with 1 segment... The IDoc is not standard, and has a lot of fields, but I want to fill only a few of them in some segments. Lets say, that I have 4 segments, with occurence 0..999999, each value has occurence 0..1 like following..
    seg1-val1
        -val2
        -val3
    seg2-val1
        -val2
        -val3
    seg3-val1
        -val2
        -val3
    seg4-val1
        -val2
        -val3
    and I have source message like
    <seg1>
      <val1>..</val1
    </seg1>
    <seg1>
      <val1>..</val1>
    </seg1>
    I think, I have to map seg1 tag to seg1 segment, and val1 tag to val1 field..
    But! DO I HAVE TO MAP also seg1 tag to seg2, seg and seg4 segment? (to create logical "table"), or it is not necessary...
    Next question: what value should be assignet to @SEGMENT attribute of segments? also (IDOC segment?) Should it be some constant?
    Thank you guys!

    All you need to map is <b>seg1</b> source to <b>seg1</b> target and <b>val1</b> source to <b>val1</b> target . But remember that, if your source has seg2,seg3,seg4 and you want to use them then map them accordingly otherwise no need to map.
    @SEGMENT is counter for the number segments you are passing for each type of record. Use a java function to populate or just populate a constant 1.
    regards
    Shravan

  • My safari wont open it flashes closed whenever I try?  What did I do

    y safari wont open it flashes closed whenever I try?  What did I do

    Try clearing Safari's cache : Settings > Safari > Clear Cache (and Clear History)
    If that doesn't work then try closing Safari completely and then re-open it : from the home screen (i.e. not with Safari 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Safari app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    A third option is a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

Maybe you are looking for

  • FI-AP

    we want to bring the paid legacy invoices into SAP in such a way that the invoice is considered to be paid in SAP. Our payment program should not pick up these invoices for payment since they have already been paid in the legacy system. Is there any

  • How to create hyperlink in email to send out

    I received email with web address (appear in blue words) in it, I can just click on the address and will direct to that page. But I couldnot do this in my email send out. Is there any setting in firefox to do this. Thank you.

  • Ich bräuchte eine anleitung für den Zen v auf deutsch. I need a German guidance for my Zen v

    I have some little Porblmes with ma Zen v. So questions like: Can i give mi Zen v only power y docking on the pc, or is there any cable to plug socket. And what is a removable disk? I cant speek english very well, but i hope you undertsand what i mee

  • Trash box refuses to allow deleted mail to be moved there

    I've trawled through the posts and so far not found this exact problem so I thought I'd post here. Until last week I had no problems with Mail, but suddenly when deleting emails as usual the pop3 Trash refused to co-operate and gave me the following

  • Dynamic receiver determination for synchron interface

    Hello everybody, I want to use dynamic receiver determination for a synchron scenario. The problem is, that the interface 'ReceiverDetermination' (http://sap.com/xi/XI/System SAP BASIS 7.00) is a asynchron interface. This leads to an error when activ