How to get return code or parameters from PL/SQL in my shell script ?

My shell script must check the result of PL/SQL's running, and decide what to do in the next step.

I think you put the problem the wrong way.
You should try to do as much as possible through your SQL scripts, and, if you need to make OS calls, you may do that using host(command_string).
If you need to transfer parameters from other programs to your FORMS (PL/SQL), then you have to see user_exit.
Some other means would be to have your PL/SQL write to certain OS files that the shell script may read, but that doesn't seem like good practice to me.

Similar Messages

  • How to get Workflow code/wtf file from Oracle Customization Form

    Hi All,
    I am new to this forum. Can some one please help me how to get this wft file from customized oracle PO form ?
    Thanks,

    Pl post details of OS, database and EBS versions.
    What is "this wft" file ? WFT files are txt files of workflow definitions that can be downloaded from the database (or uploaded to the database) using WFLOAD utility.
    HOW TO DOWNLOAD WORKFLOW FILE .wft          [Document 578248.1]
    How To Update and Move Workflow From One Instance to Another?          [Document 398460.1]
    HTH
    Srini

  • How to get return code of compiling a package

    Hi,
    i want to compile a package and if it was not succesfull to write the error_message from "show errors" into a file.
    thx
    Wolle

    the problem with compiling individual packages is that you might inadvertently invalidate others. you should also programmatically check package dependencies too so you dont break any accidentally.
    if you're only compiling package bodies, this shouldn't be an issue, but if youre also compiling specs, this is something you should keep an eye on.
    i wrote an application that uploads new packages i commit in cvs to our database and then recompiles them. it then reports whether or not compilation was successful. this helps eliminate alot of user error when people manually recompile packages in HA environments. however, i recompile the entire schema when i do this (this is not something run very often). i can get away with this at my shop because the schema is very small, but this might not be a practical solution for everyone.
    this is how i check for dependencies:
    FROM public_dependency pd, user_objects uo
    WHERE referenced_object_id IN (select object_id from user_objects where object_name= UPPER(?))
    AND uo.object_id = pd.object_id
    this is useful for saving a snapshot of current package (in case of reversion):
    SELECT TEXT FROM USER_SOURCE WHERE NAME = ?
    this is how you can recompile the schema:
    DBMS_UTILITY.COMPILE_SCHEMA(?, TRUE, TRUE);
    i do a check for invalid objects in the schema before i even start (And exit with error if any are found) :
    SELECT OBJECT_NAME, STATUS
    FROM USER_OBJECTS
    WHERE (OBJECT_TYPE='PACKAGE' OR OBJECT_TYPE='PACKAGE BODY')
    AND STATUS <> 'VALID'
    Hope this info helps.
    Edited by: user577162 on Aug 25, 2008 2:21 PM

  • How to get return value from Java runtime.getRuntime.exec?

    I'm running shell commands from an Oracle db (11gr2) on aix.
    But, I would like to get a return value from a shell comand... like you get with "echo $?"
    I use a code like
    CREATE OR REPLACE JAVA SOURCE NAMED common."Host" AS
    import java.io.*;
    public class Host {
      public static int executeCommand(String command) {
        int retval=0;
        try {
            String[] finalCommand;
            finalCommand = new String[3];
            finalCommand[0] = "/bin/sh";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
       catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
          retval=-1;
        return retval;
    /but I do not get a return value... because I don't know how to get return value..
    Edited by: user9158455 on 22-Sep-2010 07:33

    Hi,
    Have your tried pr.exitValue() ?
    I think you also need a finally block that destroys the subprocess
    Regards
    Peter

  • How to get the Portal Page name from PLSQL?

    Can anyone tell me how to get the portal page name from my dynamic page using plsql?
    Apparently you can get the page id and work it out from there, but my calls to get the page id are not returning any values anyway.
    My code for attempting to get the page id is below.
    <oracle>
    declare
    v_pageid varchar2(30);
    begin
    v_pageid := wwpro_api_parameters.get_value('_pageid', '/pls/portal30');
    htp.print('Page is '|| v_pageid);
    end;
    </oracle>
    Ideally I'd actually just like to get the page name. Is there a straightforward way to do this?
    Thanks in advance!
    Sarah

    Few clarifications -
    1. wwpro_api_parameters cannot be used to get default portal
    page parameters such as '_pageid', '_dad', '_schema' etc.,
    2. Page information can be obtained through any components which
    are available in that particular page. For example, in case of
    dynamic page, we need to publish it as a portlet and add it to the
    page. This process creates necessary packages in the DB, but we
    will not have access to the portlet methods.
    So, I would prefer creating a simple DB provider & portlet and access
    page title from its show method as follows -
    //Declare local variable l_page_id, l_page_title as varchar2
    select page_id into l_page_id from wwpob_portlet_instance$ where
    portlet_id = p_portlet_record.portlet_id and
    provider_id = p_portlet_record.provider_id;
    select name into l_page_title from wwpob_page$ where id=l_page_id;
    More information on DB provider can be found at
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/articles/understanding.database.providers.html
    Secondly, usage of wwpro_api_parameters.get_value method is
    incorrect. This method expects two arguments -
    <ul>
    <li><b>p_name : </b> The name of the parameter to be returned.</li>
    <li><b>p_reference_path : </b> An unique identifier for a portlet instance on the current page.</li>
    </ul>
    p_reference_path would be something like 99_SNOOP_PORTLET_76535103 and not some type of path as its name suggests.
    The following code fragment fetches all parameters available
    for a portlet.
    Note : Copy this code into 'show' method of your portlet.
    //Declare l_names, l_values as owa.vc_arr
    * Retreive all of the names of parameters for this portlet
    l_names := wwpro_api_parameters.get_names(
    p_reference_path=>p_portlet_record.reference_path);
    * Retreive all of the values of parameters for this portlet
    l_values := wwpro_api_parameters.get_values(p_names=>l_names,
    p_reference_path=>p_portlet_record.reference_path);
    //Loop through these arrays to get parameter information
    htp.p('<center><table BORDER COLS=2 WIDTH="90%" >');
    htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
    htp.tableData(wwui_api_portlet.portlet_heading('Name',1));
    htp.tableData(wwui_api_portlet.portlet_heading('Value',1));
    htp.tableRowClose;
    if l_names.count = 0 then
    htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
    htp.p('<td COLSPAN="2">'
    ||wwui_api_portlet.portlet_text(
    'No portlet parameters were passed on the URL.',1)
    ||'</td>');
    htp.tableRowClose;
    else
    for i in 1..l_names.count loop
    htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
    htp.tableData(l_names(i));
    htp.tableData(l_values(i));
    htp.tableRowClose;
    end loop;
    end if;
    htp.p('</table></center>');
    Hope it helps...
    -aMJAD.

  • How to get password as string back from encrypted password byte array.

    Hi All,
    I am storing encrypted password and enc key in the database.(Code included encryptPassword method for encryption and validatePassword method for validating of password). Problem is that for some reason i need to show user's password to the user as a string as he/she entered. But i am not able to convert the encrypted password from D/B to original String.
    Tell me if any body know how to get the string password back from the encrypted password byte array after seeing my existing encryption code.
    //********* Code
    private Vector encryptPassword(byte[] arrPwd)
    try
    // parameter arrPwd is the password as entered by the user and to be encrypted.
    byte[] encPwd = null;
    byte[] key = null;
    /* Generate a key pair */
    KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA", "SUN");
    SecureRandom random = SecureRandom.getInstance("SHA1PRNG", "SUN");
    keyGen.initialize(1024, random);
    KeyPair pair = keyGen.generateKeyPair();
    PrivateKey priv = pair.getPrivate();
    PublicKey pub = pair.getPublic();
    /* Create a Signature object and initialize it with the private key */
    Signature dsa = Signature.getInstance("SHA1withDSA", "SUN");
    dsa.initSign(priv);
    /* Update and sign the data */
    dsa.update(arrPwd, 0, 12);
    /* Now that all the data to be signed has been read in, generate a signature for it */
    encPwd = dsa.sign();
    /* Now realSig has the signed password*/
    key = pub.getEncoded();
    Vector vtrPwd = new Vector(2);
    vtrPwd.add(encPwd);
    vtrPwd.add(key);
    return vtrPwd;
    catch (Exception e)
    private boolean validatePassword(byte[] arrPwd,byte[] encPwd,byte[] key) throws RemoteException
    try
    // arrPwd is the byte array of password entered by user.
    // encPwd is the encrypted password retreived from D/B
    // key is the array of key through which the password was encrypted and stored.
    X509EncodedKeySpec KeySpec = new X509EncodedKeySpec(key);
    KeyFactory keyFactory = KeyFactory.getInstance("DSA", "SUN");
    PublicKey pubKey = keyFactory.generatePublic(KeySpec);
    /* Encrypt the user-entered password using the key*/
    Signature sig = Signature.getInstance("SHA1withDSA", "SUN");
    sig.initVerify(pubKey);
    /* Update and sign the password*/
    sig.update(arrPwd, 0, 12);
    return sig.verify(encPwd);
    catch (Exception e)
    Help upto any extent would be appreciated.
    Thanx
    Moti Singh

    Hi All,
    I am storing encrypted password and enc key in the
    database.(Code included encryptPassword method for
    encryption and validatePassword method for validating
    of password). Problem is that for some reason i need
    to show user's password to the user as a string as
    he/she entered. But i am not able to convert the
    encrypted password from D/B to original String.No, you are not encrypting the password in your code, you are merely signing it.
    Tell me if any body know how to get the string
    password back from the encrypted password byte array
    after seeing my existing encryption code.It is impossible to retrieve the original text out of a signature.
    You should read up on some encryption basics in order to understand the difference between signing and encrypting. Then you can find examples of how to encrypt something here: http://java.sun.com/j2se/1.4/docs/guide/security/jce/JCERefGuide.html.
    Actually there is one class specifically for keeping keys secure, KeyStore http://java.sun.com/j2se/1.4/docs/api/java/security/KeyStore.html
    - Daniel

  • AFPPRN received a return code of failure from the OSD routine FDUPRN

    Hi all,
    Operting system : Solaris 9
    Oracle application: 11.5.10
    i would like to ask query related to buffer area of pinter on solaris server.
    we are trying to print cheques using oracle application on network printer.
    some times it is printing the cheques with out any problem but sometimes it throws and error message in concurrent request log file.
    ****************** L O G F I L E C O N T E N T S ***************
    Printing output file.
    Request ID : 849798
    Number of copies : 1
    Printer : radch1
    Pasta: Error: Error reading input file for type checking.
    APP-FND-00500: AFPPRN received a return code of failure from routine FDUPRN. An error occurred while AOL tried to spawn the print process
    Cause: AFPPRN received a return code of failure from the OSD routine FDUPRN. An error occurred while AOL tried to spawn the print process.
    Action: Review your concurrent request log file for more detailed information.
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 20-AUG-2009 11:49:18
    ****************** L O G F I L E C O N T E N T S ***************
    my question is
    1) Do we need to delete any temporary files from server related to printer.
    Regards

    Hi,
    What is the status of those concurrent requests (Completed with Warning or with Error)?
    1) Do we need to delete any temporary files from server related to printer.Usually, you do not need to delete any files manually, temp files will be created by the application, and there should no issues with the files permissions (unless you have some other instance running on the same node with different applmgr user). However, you can safely clean (.t and .tmp) files as per the following documents.
    Note: 435437.1 - Most Common Solutions to FRM-41839 and .tmp Files Not Being Deleted
    Note: 145487.1 - Files Types .t and .temp and .tmp, are Saving Under /var/tmp
    Note: 162232.1 - Why Does Oracle Forms Create .TMP Files Which Fill Up The Filesystem e.g. /tmp ?
    I would also suggest you search Metalink for APP-FND-00500 and you will get many hits, go through the documents and see if it helps.
    Regards,
    Hussein

  • How to get the backup of photos from  i cloud id ?

    plz provide me the answers as soon as possible.

    BALAJI_PRASANNA wrote:
    Hello,
    I am very new to Labview. Í have an image of an LED and wanted to find the luminance value. I got the luminance image from the IMAQ ExtractSingleColorPlane but the value is not displaying. I just wanted to know how to get the value of luminance from the IMAQ ExtractSingleColorPlane. I have attached what i have done below.
    Thanks in advance.
    Before learning about LabVIEW, learn about images.  An Image (in LabVIEW) is a "representation of an image", that is, the wire itself doesn't really have a "value", but "points to" a collection of data that can be "imaged" (i.e. looked at as through it were a picture), "manipulated" (for example, extracting a color plane, basically getting the "red channel", an image looking as through it were viewed through a red filter), and possibly returning arrays of numbers representing the intensity of the light at a certain position in the picture.  
    BS

  • How to get the default selection color from JTable

    Hi, there,
    I have a question for how to get the default selection color from JTable. I am currently implementing the customized table cell renderer, but I do want to set the selection color in the table exactly the same of default table cell renderer. The JTable.getSelectionBackgroup() did not works for me, it returned dark blue which made the text in the table unreadable. Anyone know how to get the window's default selection color?
    Thanks,
    -Jenny

    The windows default selection color is dark blue. Try selecting any text on this page. The difference is that the text gets changed to a white font so you can actually see the text.
    If you don't like the default colors that Java uses then use the UIManager to change the defaults. The following program shows all the properties controlled by the UIManager:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java
    Any of the properties can be changed for the entire application by using:
    UIManager.put( "propertyName", value );

  • How to get list of file names from a directory?

    How to get list of file names from a directory?
    Please help

    In addition, this:
    String filename = files;Should be this:
    String filename = files;
    That's just because he didn't use the "code" tags, so [ i ] made everything following it become italicized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get InputStream of uploaded file from request?

    The situation:
    Client is uploading xml file to server.
    <form METHOD=POST ENCTYPE = "multipart/form-data" action="SendFile" accept="text/xml">
              <input type="file" name="SentFile" />
              <input type="submit" value="go"/>
    </form>Then I need to parse data from file.
    I want to use method javax.xml.parsers.DocumentBuilder.parse(InputStream is)
    But, how to get InputStream of uploaded file from request?

    You cannot get the InputStream of the uploaded file directly. The InputStream you can obtain from request.getInputStream() contains a lot of other data as well as the uploaded file. You will have to parse the data in the InputStream to find the data that belongs to the file.
    A short cut is to use the HTTP Multipart File Upload available from www.jenkov.com. It simplifies file upload and makes it easy to obtain an InputStream for only the uploaded file. It also handles upload of multiple files. It is free, open source, Apache license, so if it doesn't fit your needs, you can always read the code and see how it works. Then write your own upload servlet.

  • Getting error , while passing parameters from one page to another page

    Hello friends,
    i am getting error, while passing parameters from one page to another page, below code i wrote.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    ArrayList arl=new ArrayList();
    EresFrameworkAMImpl am=(EresFrameworkAMImpl)pageContext.getApplicationModule(webBean);
    ERecordImpl ERecordObj=new ERecordImpl();
    HashMap hMap = new HashMap();
    hMap.put("1",ERecordObj.getTransactionName());
    hMap.put("2",ERecordObj.getTransactionKey());
    hMap.put("3",ERecordObj.getDeferredMode());
    hMap.put("4",ERecordObj.getUserKeyLabel());
    hMap.put("5",ERecordObj.getUserKeyValue());
    hMap.put("6",ERecordObj.getTransactionAuditId());
    hMap.put("7",ERecordObj.getRequester());
    hMap.put("8",ERecordObj.getSourceApplication());
    hMap.put("9",ERecordObj.getPostOpAPI());
    hMap.put("10",ERecordObj.getPayload());
    // hMap.put(EresConstants.ERES_PROCESS_ID,
    if(pageContext.getParameter("item1")!=null)
    pageContext.forwardImmediately(EresConstants.EINITIALS_FUNCTION,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    hMap,
    true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES
    Error(71,2): method forwardImmediately(java.lang.String, byte, null, java.util.HashMap, boolean, java.lang.String) not found in interface oracle.apps.fnd.framework.webui.OAPageContext
    Thanks
    krishna.

    Hi,
    You have imported the wrong class for HashMap.
    Import
    com.sun.java.util.collections.HashMap; instead of java.util.HashMap
    Thanks,
    Gaurav

  • How to get PPA Code

    Hi Friends,
                      Can u please let me know how to get PPA Code from ZZ_PPA_C.
    Please help me its urgent.
    Regards,
    Rajiv Kaushal

    What do you mean?
    The restriction code would be whatever you set it to be.
    There is no restriction codeunless you set it.

  • How do you return back one record from a NamingEnumeration

    how do you return back one record from a For Loop issue
    Posted: Jan 4, 2007 9:13 AM Reply
    I have the following piece of code and i want to be able to just return one item...
    that is return e.next(); but this line doesnt work for below what is wrong
    if (attrs == null) {
    System.out.println("No attributes");
    } else {
    /* Print each attribute */
    for (NamingEnumeration ae = attrs.getAll();
    ae.hasMore();) {
    Attribute attr = (Attribute)ae.next();
    System.out.println("attribute: " + attr);
    /* print each value */
    for (NamingEnumeration e = attr.getAll();
    e.hasMore();){
    System.out.println("value:- " + e.next()));
    return e.next();
    }

    At the end of the loop, the NamingEnumeration has no more elements. You need to call getAll() again.
    By the way, please use code tags (above the posting box). You've been here long enough to know that (judging by your registration date).

  • How to get names of method parameters ?

    How to get names of method parameters (Not only their type and value) is it only possible during debugging ??
    for example void myFunction(int a,int b)
    I need the "a" , and the "b" The issiue is about the java.lang.reflect.InvocationHandler ,
    and its method invoke(Object proxy,
    Method method,
    Object[] args)
    throws Throwable
    I Have the parameter objects themself and their types using method.getParameters() , this is fine ,, but i need the names of the parameters !!!

    If the class file was compiled without debug information included then it is impossible to get the original parameter names, as used in the source code.
    However, If the class file does include debug information, then the method names are hidden deep within the class file. You'd need to parse the class file yourself. Check out a copy of the Java VM Specification for a detailed format of the java class file format.
    It's not a trivial task to parse the java class file, and the VM spec isn't easy reading. You'd nearly be writing a class file disassembler.

Maybe you are looking for

  • Installing new internal hard drive.  How do I safely clone my existing BOOTCAMP partition?

    I have a 13 inch Aluminum Late 2008 MacBook.  Processor 2 GHz Intel Core 2 Duo, Memory 4 GB 1067 MHz DDR3, Software Mac OS X Lion 10.7.4 (11E53).  Currently I have a 160 GB SATA disk as my hard drive a d 4 GB of memory.  (Is it time to upgrade or wha

  • Delivery dates need to be reset

    Hi all, I came across a scenarion: Client wants that while creating Sales Order, the delivery date should pick up only the furture date and no past dates or current dates should be picked up. the options in the delivery date should be like this : fut

  • Overdrive Media Player for Ipod Classic late 2009

    Hi I am unable to transfer from Overdrive Media Player even though I have followed the instructions. It keeps telling me it is unable to connect and that iTunesw v9.02 or newer (I have version 10) is required. I have also enabled manually manage musi

  • Problem PS-Elements 6 & 7

    Das Umschalten vom Voll-Editor zum Schnell-Editor dauert 10 Sek. (Desktop Computer neuester Generation). Beim Notebook dauert es nur 2 Sek. Was muss ich verändern, um diese lästige Wartezeit zu verkürzen? Danke im Voraus. Wolfgang Kieckbusch

  • Need Help :  How to make particular Record  in Bold

    Hi Frnds, I am facing the problem to resolve the following issue....... Plz... help me out ......... I am displaying the payslip information (Elements Information ) in a Table. In the table , i am showing the "DEDUCTIONS TOTAL"  , "EARNING TOTAL" and