How to make the output of Sql Plus with an error Code

Dear members,

How can I define sql more exit with an error code.

We have a simultaneous host program. The executable is a shell script for this program. This sql script Shell script request which in turn gives call to a custom database package that I built.

The flow rate is:


-> SQL-> CUSTOM PACKAGE SCRIPT SHELL SCRIPT

Custom package has two PARAMETERS of the error indicator and the error message. If something fails in the package these two PARAMETERS is returned with a value.

So my sql script code looks like this:

WHENEVER SQLERROR EXIT 251
WHEN the OSERROR EXIT 251
Set serveroutput size 1000000
set linesize 32767
set verify off
set the position
Set feedback off

DECLARE
x_error_message VARCHAR2 (1000);
x_sql_message VARCHAR2 (1000);
x_exception EXCEPTION;
e_value NUMBER;

BEGIN
dbms_output.put_line ('Inside sql file');


XXpackage.xxproc (x_error_message, x_sql_message);


IF (x_error_message IS NOT NULL) AND (x_sql_message IS NOT NULL) THEN
RAISE x_exception;
END IF;


EXCEPTION
WHEN X_EXCEPTION THEN
e_value: = 1;
DBMS_OUTPUT. Put_line (' Exit Code: ' | e_value);
DBMS_OUTPUT. Put_line ('X_EXCEPTION: EXCEPTION IN SCRIPT xpoext04a.sql :'||) SQLERRM);
DBMS_OUTPUT. Put_line ('x_error_message is: ' | x_error_message);
DBMS_OUTPUT. Put_line ('x_sql_message is: ' | x_sql_message);
DBMS_OUTPUT. PUT_LINE (' ERROR IS: ' |) SQLERRM);
WHILE OTHERS THEN
e_value: = 252;
DBMS_OUTPUT. Put_line (' Exit Code: ' | e_value);
DBMS_OUTPUT. Put_line (' OTHER: EXCEPTION IN SCRIPT xpoext04a.sql :'||) SQLERRM);
DBMS_OUTPUT. Put_line ('x_error_message is: ' | x_error_message);
DBMS_OUTPUT. Put_line ('x_sql_message is: ' | x_sql_message);
DBMS_OUTPUT. PUT_LINE (' ERROR IS: ' |) SQLERRM);


END;
*/*
output
*/*


As you can see from above, if the two PARAMETERS have value, then it goes to an exception.

My problem is that if it goes with the exception of X_EXCEPTION, the sql is not come away with a mistake. I mean sql is not treat this case like a sqlerror.


How can do us more sql dating a sqlerror so that the host program must fail.


Thank you
Sandeep

Published by: user340 on July 28, 2009 12:51

Published by: user340 on July 28, 2009 12:57

the plu sql is not come away with a mistake. I mean sql is not treat this case like a sqlerror.

This is because there is no error. You handled the exception.

You can try adding a STIMULUS; at the end of your exception section. This re-triggers the exception so sql liked to see it.

Tags: Database

Similar Questions

  • How to make the output of the task are an entry in another task

    How to connect the output of a task for I can use it as input for another task?  See this screen below: the task "Invoke the Script" run a PowerShell Script.  The task 'Send E-mail' send an email.  The two tasks work separately.  How can I get the results of my powerShell script that I can use them as content of the task 'Send Email'?

    workflow.jpg

    On the script invoke task you set the attributes of output containing the results of powershell.

    to do this, select the output tab and use an object name that was put in place in powershell results as in the data

    You may need to format, this results in a recognized VMware object I guess in your case it is a string type.

    and then select the e-mail task, select the task from email, click on the small eye looking for icon "view details".

    Select the Visual link

    Select the attributes you setup from the output of the previous task and hang it in the input parameters of the task to email.

    fact

  • How to make the output of g + rw EXPDP

    Hi all

    11.2.0.1

    AIX 6.1

    I export tables using expdp, but the output is read, write only to the owner. I can't read, write to group as well.

    Help, please.

    Thank you

    zxy

    The oracle is create dump file with permission "- rw - r" - for expdat.dmp and "- rw - r - r" - so that it expdat.dmp: export.log as you say. I tried to change the umask, but it makes no difference to him. so, if you want to change the permission, you will need to manually using chmod command in linux.

  • How to make the printer deskjet 3940 compatible with Windows 7 Home Basic, 32-bit?

    I have the HP Deskjet 3940 printer. I recently bought a Lenovo (C320, 57-302429) desktop computer that has Windows 7 home basic, 32-bit operating system. The said printer does not work with the computer above. Please guide how to make this printer compatible with the operating system above.

    1. click on the Start button, select Control Panel and double-click devices and printers.

    2. click on Add a printer.

    3. Select Add a local printer.

    4. Select an existing Local USBx port, click Next.

    5. click on the Windows Update button.

    6. once the update is complete, locate the 3940 driver.

    7. click on Next,Next,Next,Next,Finish

  • How to make the animated lips that move with the text?

    Hello

    I would like to make the animated lips (as below) say some text. So I would like to move with the text that is said.

    What would be the best way to do it in an Adobe program? Thanks in advance!

    lips photo.jpg

    The best way to do it would be to learn now to use Adobe character animation. Simply design a work in layers so that the different sounds are on different layers.

    There are also manual techniques that require a familiarity with the distortion and masking tools in AE and a knowledge of the time remapping effect. You can also use audio levels to trigger the movement. Using this technique you can divide the image in the upper lip, lower lip and then use expressions to drive to position distortion tools. The good technique depends on the look you are after. If you just want to use those lips she's going to be quite difficult to get a "oh" sound or a 'b' as in "oh Boy" which seems natural.

    Are you new to AE? What you are wanting to do will require some basic skills in AE and probably Photoshop or Illustrator.

  • How to request the pdf to open it with adobe web code plugin

    Hello, I have a pdf hosted on my site that I can't change. It does not appear in FF built in PDF preview, it crashes just with a circle of rotation being displayed. If I force FF using the software Adobe Reader (or Adobe DC or what they call it now) plugin settings/Applications will preview it without problem. Many people visit our site of FF and say that this PDF file cannot be read. Is it possible to code HTML to request the pdf to be previewed with the if available Adobe plugin? I just get "non-informatiques people" who to complaint "I don't see this PDF file" and I answer with the support of FF to modify their PDF plugin by default, a link or can I tell them to use a different browser... but if I could get just a place to use the plugin if installed Adobe, this whole mess disappears.

    I'm not an expert HTML, or a PDF expert, but I have access to the back-end web. Is it possible in HTML for a specific plugin be used if it is available?

    If not, is it possible to use HTML to apply than the built in FF overview PDF DO NOT serve?

    The PDF file was prepared in bad. Of course, the ideal situation is to use a PDF file that is displayed in the preview of FF, but this is not possible. This is not the first time that this problem came, and this isn't the only PDF I've seen with this problem.

    No, a Web page has no control over the PDF viewer is used. It is strictly a user choice.

  • How to make the output project of "Continue" button on the attempt of quiz results page

    When the quiz on the project is completed, on the results of the quiz slide it has a button to continue to press, but seems no value since it becomes just a black screen when you are finished instead of close the project as you think it should. Any suggestions on how to do that affects the project?

    Closing projects only works reliably when the publication in EXE format.  Often Web browser security prevents content windows SWF/HTM being closed in the same way.

    Try placing a slide AFTER your quiz slides so that the button continue has a place to go.  Then change your preferences > project > start and end > project end Options > Action close project.  In this way, the project tries to close naturally, only not in a row by clicking a button.  You can do this last slide as short as you want, but a second or more is generally good, just in case you have preferences set to Fade Out on last slide.

  • How to make the menu drop-down list with a scroll bar

    Hello

    I have a drop-down list that is filled with different table sizes.

    I have a size of 30-element array.  Some of the last items just go off the screen at the bottom of the Simulator PB.

    Is it possible for me to add a drop-down scroll bar?

    DP = new DropDown();
    dp.rowHeight = 24;
    DP.prompt = "stuff";
    DP. Height = 34;
    DP.width = 230;
    DP.x = TitleTB.x + 170;
    DP.y = Title.y-3;
    addChild (dp);

    Some of the tables look like this-

    case 'List 1':
    dp.rowCount = 2;
    for (var i: int = 0; i<2;>
    {
    if(i==0)
    {
    DPP.splice (0);
    DPP.unshift({label:"blahblah"});)
    }
    else if (i == 1) {}
    DPP.unshift({label:"foofoo"});)
    }
    }
    dp.dataProvider = new DataProvider (dpp);
    addChild (dp);
    break;

    case "List2":
    dp.rowCount = 30;
    for (var n: int = 0; n<30;>
    {
    if(n==0)
    {
    DPP.splice (0);
    DPP.unshift({label:"lalalala"});)
    }
    Else if (n == 1) {}

    **********

    Delete the existing table using splice (0);

    then I add the new array of labels.

    Before, when I didn't have the splice (0), I only had the .unshift () and sometimes got bays combined together and a scroll bar appears automatically in the Simulator.  But then the berries were mixed.

    Thanks for the help!

    Hey mlin13,

    from the looks of it, your property rowCount is set too high. the rowCount property represents the number of lines displayed on the screen when the drop down menu is open. so if the number of rows is less than the amount of items on the list, it will create a scroll bar with a drop-down list for you. try to set the number of lines to a default value of 10 and and keep it manipulate your list from there. and see if you get the desired results. Good luck!

  • How to make the work of e/s with this?

    Basically, I'm reading a file on the disk properties hard local servers VMO.  I tried a Properties.load command with a valid path, but it doesn't seem to work.  I then resorted to the object filewriter giving an explicit filepath on the VMO server.  For example: "C:\myfile.txt", but it no longer works.  What I'm missing here?

    ~ Patrick

    Don't forget if the answers help you, award points

    Yes, in Javascript as in Java, you must place two------------instead of one or the use of the / to set path strings

  • Cannot download Lightroom CC compared to the Creative clouds - download stalls with no error code given

    Download normally up to 90 per cent, then rest indefinitely on 90 percent. After creative cloud restarts, download status goes to "undo...". "and stay like that forever. Was slaughtered like this for three days now...

    Any ideas? The different ways to download? Ask here for the 24/7 from Adobe online chat is apparently closed

    (Running Mac OS Yosemite with stable internet connection)

    Thank you Brucgovn - I have restarted the computer, restarted CC and Lightroom had been installed. Problem solved.

  • The file is not compatible with InDesign (error code: 14)

    Hello

    I'm on OS X 10.8.2, MacMini end 2009, 6 GB RAM, 190 GB OS Partition with 89 GB free, Adobe InDesign CS6. InDesign is authentic, it is licensed to cloud.

    I get this error for any file I am trying to open. Although files each time I remove recovery of InDesign, InDesign opens, but when I try to open any file I get this error.

    Initially, I tried to open document library. Looks like I get this errors whenever a ddocument has a library to him atttached. Creating problems?

    Any solution?

    Kind regards

    Sebastian

    We will try other minor surgery.

    Close ID (I know, it is already closed).

    Trash the prefs.

    Bin data recovery.

    Recycle Bin, the files listed here: Forums Adobe: InDesign crashes at startup

    Trash ALL the files. XML 'Current' working space in your library user in the folder of the workspace. You can leave the base files. Simply remove the current configuration of those that they can refer to the missing library.

    Temporarily remove the FontXplorer of ID plugin.

    Try to open the code.

    If it works, close and move the plugin back, and then try again.

    If you still have problems, see Troubleshooting fonts | Mac OS X

    It is possible that the stuff of office has done some damage to ID, too. If all else fails, uninstall, run the clean tool (CS for installation problems cleaning tool |) CCM, CS6, CS5.5, CS5, CS4, CS3) and reinstall and update the ID again.

  • How to make the window disappears after minimize instead of becoming the output of the image?

    How to make the window disappears after minimize instead of becoming the output of the image?

    Hi Sam,

    This issue may have caused due to infection by the virus or system files missing or damaged or because of the corruption of the user profiles. I would like to know some information about this problem so that we can help you further.

    1. have you made changes on the computer before this problem?

    2. do you get any error code or error message while starting?

    3. have you checked if the problem occurs on a different user account?

    I would suggest trying the following methods and check if it works for you.

    Method 1:

    Run the Microsoft Safety Scanner and check if there is any threat of viruses found.

    Microsoft safety scanner: http://www.microsoft.com/security/scanner/en-us/default.aspx

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. During these 10 days, it will remove all the files infected by the virus and records. I suggest you create a backup of your data, and then install Microsoft Safety Scanner.

    Method 2:

    Run the System File Checker scan and check if it helps. This will help you to find and replace missing or damaged system files.

    See the following article from Microsoft Support to run the System File Checker.

    http://support.Microsoft.com/kb/929833/en-us

    Method 3:

    If you have not checked if the problem occurs on a different user account are not, then try again to create a new user account and check if the problem persists. This is to check if the problem is caused due to the corruption of user profiles or not.

    See the following article from Microsoft Help to create a new user account.

    http://Windows.Microsoft.com/en-us/Windows/create-user-account#create-user-account=Windows-7

    If the problem does not persist in the new user account, then try the steps in the following article from Microsoft Help to fix the damaged user profile.

    http://Windows.Microsoft.com/en-us/Windows/fix-corrupted-user-profile#1TC=Windows-7

    Please reply with the status of the issue so that we can better help you.

  • Out of the queue of SQL * Plus for Excel

    I'm out of the queue of SQL * Plus for Excel. The code I use is down. I want that all white space to carve when I open the updated file waiting in Excel. How can I ensure this?

    I was reading on the SET TRIM command, but it says that it does not affect the output queued. (http://ss64.com/ora/syntax-sqlplus-set.html)

    Is there a way to NOT display whitespace at the beginning and the end of a column in SQL * more? In other words, if I shoot a single column of a record, and a data element is only 3 characters in length, I want to be also 3 characters instead of extending over 40 characters across the width of the column.


    The column for your troubleshooting information
    IDNUMBER is NUMBER (12)
    FIRST is VARCHAR2 (40)
    The LAST is VARCHAR2 (60)


    Code
    SET LINESIZE 100
    SET PAGESIZE 0
    SET MARKUP HTML PREFORMAT ON
    set colsep,
    coil c:\prospects.csv
    Select '' perspective ID"', '" First"',""finally" "from dual;
    Select to_char (p.idnumber), p.first, prospect_view p.last p where idnumber = 164515;
    spool off

    DataHandle wrote:
    I'm out of the queue of SQL * Plus for Excel. The code I use is down. I want that all white space to carve when I open the updated file waiting in Excel. How can I ensure this?

    I was reading on the SET TRIM command, but it says that it does not affect the output queued. (http://ss64.com/ora/syntax-sqlplus-set.html)

    TRIM affects the expressions in your SELECT clause. It has nothing to do with the padding of SQL * Plus adds to align the columns upwards.

    Is there a way to NOT display whitespace at the beginning and the end of a column in SQL * more? In other words, if I shoot a single column of a record, and a data element is only 3 characters in length, I want to be also 3 characters instead of extending over 40 characters across the width of the column.

    Here's a way to make the main request:

    SELECT        TO_CHAR (idnumber)
    || ',' ||  first
    || ',' ||  last
    FROM           prospect_view
    WHERE        idnumber     = 164515
    ;
    

    This will include spaces only if they occur in first or last. Depending on your data and your requriements, you may need to use the FILLING (first) instead of the first, and/or TRIM (finally) instead of the last.

    Using this technique, it does not matter what is COLSEP: the query produces a single column.

    Use the SQL * more order

    SET  TRIMSPOOL ON
    

    to keep SQL * more add space after this single column.

  • How to make the status of concurrent program error

    Hi Experts,

    I've written a PL/SQL package procedure, created an executable w / values for my 2 IN parameters and he attributed to a simultaneous program to the e-business suite.

    The specification of the procedure looks like this:
    PROCEDURE PROC1 (
    errbuf OUT NOCOPY VARCHAR2 ,
    retcode OUT NOCOPY NUMBER,
    p_contract_number IN VARCHAR2,
    p_end_date_char IN VARCHAR2 
    );
    Here my requirement is like this,

    How to make the status of the program contributing to the error even if the program successfully completes.
    Please let me know how?

    Thank you
    Suman V.

    Hello

    To give an error output, simply put the RETCODE contains 2
    To give a warning output set to 1
    for and OK output set to 0.

    If your procedure may be:

    procedure proc1 (errbuf OUT NOCOPY VARCHAR2,
    OUT NOCOPY RETCODE NUMBER,
    p_contract_number IN VARCHAR2,
    p_end_date_char in VARCHAR2
    ) IS
    BEGIN
    RETCODE: = 2;
    errbuf: = ' this CR WRONG because I wanted it ';
    END;

    This will give you an error.
    It may be good to your CR PLSQL like this:

    procedure proc1 (errbuf OUT NOCOPY VARCHAR2,
    OUT NOCOPY RETCODE NUMBER,
    p_contract_number IN VARCHAR2,
    p_end_date_char in VARCHAR2
    ) IS
    BEGIN
    RETCODE: = 0;
    return;

    exception
    while others then
    RETCODE: = 2;
    errbuf: = "an error has unhandeled."
    return;
    END;

    This way execptions generate an error.

  • How to make the pdf in adobe bridge cc

    How to make the pdf in adobe bridge cc

    Adding to the rpandita station, please follow the link below for module add an exit in the most recent version of the bridge CC.

    Reference: install Adobe Output Module

    Let us know if that helps.

    Kind regards

    ~ Mohit

Maybe you are looking for