How to return an error code of SQL * Plus of PL/SQL procedure

Hello

I want to be able to pass a variable back to the Unix script, and I have the following code

******************

sqlplus/myuser mypass < < EOF
WHENEVER SQLERROR EXIT 41.
WHENEVER OSERROR EXIT 81;
execute pkonp.run_onp;
output
EXPRESSIONS OF FOLKLORE

ERRORCODE = $?

If [$ERRORCODE! = 0] #test for successful onp
then
#Notify failure of the administrator of the ONP.
echo 'Fail ONP to 'date' \n'
FI

******************
However, I am unable to get my PL/SQL to pass an error code to SQL * more.

How to catch an error in PL/SQL and pass the SQL error code *, so that SQL * Plus can then pass the error to the Unix Shell script?

Thank you very much.

Yes - in a nut shell, you need to convert Oracle codes exception to the process of Linux/Unix/Windows exit codes as the number of exception Oracle is physically too large to fit into an integer to a byte that is used by the operating system for the exit codes.

The best place to do this would be something like a SQL * more script as is the process real o/s which should only return exit code of the kernel.

Tags: Database

Similar Questions

  • function to_numer returns the error in pl/sql

    Hello
    I don't have a prob when executing select double to_number('1234.56'), the numer contains decimal numbers
    But this stm return number not valid error in the procedure, except if I use to_number('1234.56','9999999.99')
    Please help me.
    I need to set parameter in DB?
    BTW: my NLS_NUMERIC_CHARACTER has the value '.,'
    Thank you.

    function to_numer returns the error in pl/sql

    hlthanh wrote:
    Hello
    I don't have a prob when executing select double to_number('1234.56'), the numer contains decimal numbers
    But this stm return number not valid error in the procedure, except if I use to_number('1234.56','9999999.99')
    Please help me.
    I need to set parameter in DB?
    BTW: my NLS_NUMERIC_CHARACTER has the value '.,'
    Thank you.

    Handle: hlthanh
    Status level: Beginner
    Join date: March 7, 1999
    Messages total: 94
    Total Questions: 60 (38 pending)
    many questions and so few answers.
    How SAD!

  • How to fix 8024200d error code in vista ultimate sp1

    How to fix 8024200d error code in vista ultimate sp1

    You may encounter temporary connection related errors when you use Windows Update or Microsoft Update to install updates:
    http://support.Microsoft.com/kb/836941

    What application or antivirus security suite is installed and your current subscription?  What anti-spyware (other than Defender) applications?  What third-party firewall (if applicable)?

    A (another) Norton or McAfee application has already been installed on this machine (for example, a free trial version which is preinstalled when you bought it)?

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Windows Update fails to install KB974234 and returns the error code 80070641

    Previous issues with the installation of the updates or with those who just do not had are released on 11/10, but cannot install KB974234 (published on 10/13).  Update returns the error code 80070641.

    I am running Vista Home Premium with Office 2007 SP2.  Diagnostics Office finds no problem.

    Following further discussions, I have (among other attempts): stopped the Service Windows Installer (returns this message "the Windows Installer service is not started"), tried the Patch Registration Cleanup Tool (wouldn't not - said "a productcode must be determined"), downloaded manually updated.

    Any help would be appreciated!
    Dave

    Hi Dave,http://support.microsoft.com/default.aspx/kb/818018/

    http://support.Microsoft.com/kb/304498

    Hope this can solve your problems,

  • How can I fix error code 0 x 80040154 inform me please

    How can I fix error code 0 x 80040154 inform me please

    now, when I click the e-mail link in my browser (firefox) I get nothing... I got 0 x 80040154 and before that my calendar was corrupt

  • How can I fix error code 0 x 80070643 coming from upwhen essential security update?

    How can I fix error code 0 x 80070643 coming from upwhen essential security update?

    Thank you

    Sylvia

    Sylvia,

    Please see:

    During the installation of .net Framework updates with Windows update or Microsoft Update you may receive error 80070643 0 x or 0 x 643

    >>

    `~`

    The current time and the date now in Baja California, Mexico

    13:42

    Tuesday, July 16, 2013
    DST - 0700 UTC

    UTC/GMT is 20:42 Tuesday, July 16, 2013

    Current weather conditions in San Felipe

    Cloudy97 ° F / 36 ° C
  • How can you correct error code 800 F082F I get when trying to install SP1?

    How can you correct error code 800 F082F I get when trying to install SP1?

    Hello

    1. you are trying to install service pack 1 through Windows Update?
    2. What is the exact error message?

    Cause of the error 800F082F: cannot install this update with the other updates. Therefore, if you have already installed other updates without rebooting, and then you try to install this update, you may receive error 800F082F. To resolve this issue, restart your computer, and then install this update again.

    If the problem still persists, then download SP1 from the Microsoft Download Center and install it.
    For 32-bit computers: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=30
    For 64-bit computers: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=21299

  • Someone knows how to fix C015001A error code?

    Someone knows how to fix C015001A error code? I can't update my computer. It said that windows has not can check the updates. I clicked the windows update in the start menu. It does not work. I'm already the administrator.

    Hello

    Did you change your computer?

    Method 1:

    I suggest you to follow the links and check out them.

    Problems with installing updates

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-installing-updates

    How to reset the Windows Update components?

    http://support.Microsoft.com/kb/971058

    Method 2:

    I also suggest you perform the clean boot and check.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: After a repair, be sure to set the computer to start as usual as mentioned in step 7 in the above article.

  • SCardUIDlgSelectCardW returned unexpected error code, 0x8010002e, impossible to find a card reader chip.

    Event ID error msg:

    Log name: Application
    Source: Microsoft smart card CSP
    Date: 2010-06-29 22:25:22
    Event ID: 0
    Task category: no
    Level: error
    Keywords: Classic
    User: n/a
    Computer: Acer
    Description:
    The description for event ID 0 in source Microsoft smart card CSP is not found. Either the component that triggers this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

    If the event is on another computer, the display information had to be saved with the event.

    The following information has been included in the event:

    SCardUIDlgSelectCardW returned unexpected error code, 0x8010002e, impossible to find a card reader chip.

    the message resource is present, but the message is not in the string/message table

    Title: event ID of origin 0

    The event XML:
    http://schemas.Microsoft.com/win/2004/08/events/event">
     
       
        0
        2
        0
        0 x 80000000000000
       
        68716
        Application
        Acer
       
     

     
        SCardUIDlgSelectCardW returned unexpected error code, 0x8010002e, impossible to find a card reader chip.

     

    Your question of Windows Vista is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the Technet Windows Vista Security Forum

    Lisa
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How can I fix error code 194:6 (CC)?

    How can I fix error code 194:6 (CC)?

    Support contacted, they told me to do:

    1. close the CC application
    2. go to the support/adobe folder
    3 try to delete the content in the files SLCache and SLStore files

    4 run the CC application
    5. try to connect

    For me it worked perfectly

  • How can I fix error code 41?

    How can I fix error code 41

    Do you use Windows or Mac computer?

    If possible after the screenshot of error.

  • [Error code: 904, SQL State: 42000] ORA-00904: "G". "' NAME ': invalid

    When I run the SQL below, I get the following:

    08:00:08 [SELECT - 0 row (s), dry 0.000] [error Code: 904, SQL State: 42000] ORA-00904: "G". "" NAME ": invalid identifier

    When I comment the lines "BOLD", it works fine. I tried to fully qualify the column without success. I'm sure it's a matter of formatting.

    ************************************************

    Select
    SR. SCHOOLID,
    SR. StudentID, sr.coursenumber,
    SR. REGISTREQ_ID,
    (select
    min (rr.ID |) » -'|| URI COURSEGROUP)
    Of
    REGISTREQ rr
    where
    RR.grade_level = (select s.sched_nextyeargrade from student s where s.id = sr.studentid)
    and rr.yearid = 2100
    and rr.id not in (6426,6415)
    and rr. COURSEGROUP in
    (select
    g.Name
    Of
    g GEN
    where
    g.CAT = "coursegroups".
    and instr (g.valuet, sr.coursenumber) > 0
    and g.schoolid = sr.schoolid)
    and ((g.name as 'ALT %' and sr. GLOBALALTERNATECOURSE = 1)
    or (g.name not as 'ALT %' and sr. GLOBALALTERNATECOURSE = 0))
    ) as New_RegID
    Of
    SCHEDULEREQUESTS sr
    where
    SR. SCHOOLID = 703
    and sr.yearid = 2100

    This is because the lines that you have Ringing are out of reach for the alias 'g', which is part of the inner query.

    Maybe you want to just 'name' without the prefix "g.".

  • Why the HTTP become function returns the error code 63?

    I tried to use the get HTTP function to get the XML file is returned by the api Google MAPS distance-matrix. I got the right answer if I insert the url directly in the browser, but using the get HTTP function, it returns the error 63, why?

    This is my code (the VI is developed on LV2011).

    I guess, the VI GET for use with LabVIEW Web Service, only not to get of the Internet pages.

    Using the simplest way:

    Andrey.

  • How can I fix error code 0 x 80070070

    Loading windows 8 on Server 2003

    Hi Andrew,

    Thanks for posting your question in the Microsoft Community forums.

    I see from the description of the problem, you can not install Windows 8 on Windows 2003 Server and receive it error code 0 x 80070070.

    I imagine the inconvenience that you are experiencing. We are here to help and guide you in the right direction.

    To provide the proper resolution, that I would need more information on your side.

    1. how you try to install Windows 8?

    2. where did you buy Windows 8?

    3. when, exactly, you get this error code?

    Method 1:
    I suggest you to run Windows 8 Upgrade Wizard to verify that the computer is ready to install Windows 8.

    Upgrade to Windows 8
    http://Windows.Microsoft.com/en-in/Windows-8/upgrade-to-Windows-8

    Method 2:
    You may need to perform a clean installation of Windows 8, the computer is currently installed with Windows Server 2003.

    Note: Back up all your data to an external device before performing a clean install.

    How to perform a clean installation of Windows 8
    http://Windows.Microsoft.com/en-in/Windows-8/clean-install

    Let us know the status of the issue after you perform the troubleshooting steps. If you need help or information about the installation of Windows 8, I'll be happy to help you. We, at tender Microsoft to excellence.

  • How do I Fix error code 43 CD. Windows disconnected the disk do not know how to reconnect.

    My Pavilion g7us Notebook Pcs Cd-Rom Drive showed a 43 error code and my computer has disconnected the Cd-Rom drive, and he said: it will not reinstall because there is a problem with the drive, how to fix my cd-rom so that I can start my backups and use my Dvd Player and burner.

    In addition, depending on the operating system, try following the steps under "Windows 7 or Windows Vista" or "Windows XP" in the MS KB article:

    http://support.Microsoft.com/kb/982116

    These measures, to remove the UpperFilters and LowerFilters, values if they exist, in the registry key named can help.

    Create a System Restore Point beforehand and restart the computer later.

Maybe you are looking for