Unix SCRIPT CALL FROM PL/SQL

How can I call an unix script from a PL procedure ?

http://www.orafaq.com/scripts/c_src/extproc.txt

Similar Messages

  • Unix script call from java applet

    In perl you can use the system command to call a unix command like mv or ls. How do run a unix command from a java applet?

    normaly java applets are not allowed to execute any code. But there is a possibility to ask the user to be allowed to..
    in Netscpae you can use the following:
    import netscape.security.PrivilegeManager;
    then somewhere in the class...
    PrivilegeManager.enablePrivilege( "UniversalExecAccess" );
    then the user can press 'grant' or 'deni'. If he pressed grant, you can do the following:
    Process process = Runtime.getRuntime().exec( "command" );
    //where command is what ever command you like to execute
    hope that helps.
    lexip

  • Linux script call from PL/SQL does not work?

    We are trying to run a simple Linux command using this PL/SQL 10.2 procedure:
    PROCEDURE run_linux_script_from_oracle IS
        BEGIN
          dbms_scheduler.create_job
              job_name=>'runtop',
              job_type=>'executable',
              job_action=>'/vol0/FileLoadDir/Bank/DATA_FILES/spell_check.sh',
              enabled=>true,
              auto_drop=>true
          DBMS_OUTPUT.PUT_LINE('Successful');
        EXCEPTION
          WHEN OTHERS THEN
            DBMS_OUTPUT.PUT_LINE('Error: ' || SQLERRM);
        END;The .sh file has this command which works fine when we run in Linux.
    spell /vol0/FileLoadDir/Bank/DATA_FILES/ebill2.fmt_form_strings_.txt > /vol0/FileLoadDir/Bank/DATA_FILES/abcd.txtI get a Successful when I run this command in my SQL*Navigator and a PLS-00225: subprogram or cursor 'ABS' reference is out of scope when I run it in the SQL*Nav in another machine???
    Any help would be greatly appreciated.

    Channa wrote:
    We are trying to run a simple Linux command using this PL/SQL 10.2 procedure:NO, posted procedure below RUNS nothing,
    post code simply CREATE JOB, but does NOT invoke it!
    >
    PROCEDURE run_linux_script_from_oracle IS
    BEGIN
    dbms_scheduler.create_job
    job_name=>'runtop',
    job_type=>'executable',
    job_action=>'/vol0/FileLoadDir/Bank/DATA_FILES/spell_check.sh',
    enabled=>true,
    auto_drop=>true
    DBMS_OUTPUT.PUT_LINE('Successful');
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Error: ' || SQLERRM);
    END;EXCEPTION handler is BUG & should be removed, discarded & 100% eliminated.
    >
    The .sh file has this command which works fine when we run in Linux.
    spell /vol0/FileLoadDir/Bank/DATA_FILES/ebill2.fmt_form_strings_.txt > /vol0/FileLoadDir/Bank/DATA_FILES/abcd.txtI get a Successful when I run this command in my SQL*Navigator and a PLS-00225: subprogram or cursor 'ABS' reference is out of scope when I run it in the SQL*Nav in another machine???What is "ABS" & why/how does it exist in error message?

  • Photoshop scripting calls from Adobe Configurator panels

    Can javascritpt functions executing from an HTML element inside a panel affect the photoshop scene?  I know it can using the scripting toolkit, but I'm trying to do this in the Adobe Configurator.  In Configurator I created a new panel with an HTML panel and a button inside it that executes a javascript function on click "createDocument".  When I bring this into photoshop, I can load the panel and click on the button, but I never get a new document created.  If I uncomment the "alert" line, reexport the plugin, and click on the button, I get the alert, but still don't get a new document. 
    var createDocument = function() {
        app.documents.add(2,4);
        //alert("creating new doc!");
    I've tried other functions like creating layers, but still don't see anything happening in photoshop affecting the UI.  It's even more frustrating that I don't see any kind of error message that is happening.  My conclusions seem to imply this panel can't call the photoshop files for some reason (running in a different VM, wrong namespace, etc.).  Has anyone been able to make photoshop scripting calls from inside a configurator panel? 

    You might have better luck asking the in the Configurator forum. http://forums.adobe.com/community/labs/configurator/

  • Unix shell script run from pl/sql procedure

    Hi Guru
    I want to run unix shell script from pl/sql procedure. Actual I want to run it from developer 10g form.
    Please guide me in this regards
    Regards
    Jewel

    Look at the host or client_host builtins in the help

  • Unix script in Oracle Pl/sql

    I created a unix script which is automatically transfer the file from one instance to other .Now i want to call that script from pl/sql ,how can i do that
    Kindly give the suggestion

    Check the following link. It contains the steps to execute system commands from PL/SQL.
    http://www-rohan.sdsu.edu/doc/oracle/server803/A54642_01/ch8.htm

  • How to make OS calls from PL/SQL?

    Hi
    I am using Oracle 7.3.4. on Solaris platform. I want to call a unix shell script from a Database Procedure. ( Calling an OS command from PL/SQL code) ( Like the HOST() function available in the Client Side Forms Tool). Anybody can help me?

    Why?
    If you want to do this sort of thing, you would have to write a Java stored procedure that called out to the operating system. This has a number of security implications-- the OS calls will run as the Oracle OS user, so you could do fun things like deleting or corrupting data files. Frequently, there are more secure/ less complex approaches.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Script Call from ADF

    Hi All,
    can we call unix Script (Bash script) from ADF?.
    Is there any option of doing it ?
    Regards,
    Suresh kumar.k

    you can create a bean for the ADF binding the button to the actionlistenr.. and call the script just as a normal java call..
    just look at this
    http://stackoverflow.com/questions/525212/how-to-run-unix-shell-script-from-java-code

  • Web service call from pl/sql 10g

    I am having problems in calling a web service from pl/sql. This is what I followed
    Here is my wsdl
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="http://svc" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://svc" xmlns:intf="http://svc" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:types>
    <schema elementFormDefault="qualified" targetNamespace="http://svc" xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="name" type="xsd:string"/>
    <element name="location" type="xsd:string"/>
    <element name="getGreetingReturn" type="xsd:string"/>
    </schema>
    </wsdl:types>
    <wsdl:message name="getGreetingResponse">
    <wsdl:part element="impl:getGreetingReturn" name="getGreetingReturn"/>
    </wsdl:message>
    <wsdl:message name="getGreetingRequest">
    <wsdl:part element="impl:name" name="name"/>
    <wsdl:part element="impl:location" name="location"/>
    </wsdl:message>
    <wsdl:portType name="PlsqlS">
    <wsdl:operation name="getGreeting" parameterOrder="name location">
    <wsdl:input message="impl:getGreetingRequest" name="getGreetingRequest"/>
    <wsdl:output message="impl:getGreetingResponse" name="getGreetingResponse"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="PlsqlSSoapBinding" type="impl:PlsqlS">
    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getGreeting">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getGreetingRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="getGreetingResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="PlsqlSService">
    <wsdl:port binding="impl:PlsqlSSoapBinding" name="PlsqlS">
    <wsdlsoap:address location="http://myServer:7001/plsqlsvc/services/PlsqlS"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Here is my pl/sql
    package body pkg_my_webservice as
    vg_funciton_fnc VARCHAR2(256) := 'getGreeting';
    vg_ws_address VARCHAR2(255) := 'http://myServer:7001/plsqlsvc/services/PlsqlS';
    FUNCTION call_myfuntion(
    vp_parameter1 VARCHAR2,
    vp_parameter2 VARCHAR2)
    RETURN VARCHAR2 AS
    ol_req soap_api.t_request;
    ol_resp soap_api.t_response;
    BEGIN
    -- we initilize a new request
    ol_req := soap_api.new_request(vg_funciton_fnc,
    'xmlns="' || vg_ws_address || '"');
    -- we started to add parameters
    soap_api.add_parameter(ol_req,'name', 'partns:string',
    vp_parameter1);
    soap_api.add_parameter(ol_req,'location', 'partns:string',
    vp_parameter2);
    ol_resp := soap_api.invoke(ol_req, vg_ws_address, vg_funciton_fnc);
    -- we get back the results
    RETURN soap_api.get_return_value(ol_resp, 'getGreetingReturn', -- result tag name
    'xmlns:m="' || vg_ws_address || '"');
    exception WHEN others then
    dbms_output.put_line ( Utl_Http.get_detailed_sqlcode || Utl_Http.Get_Detailed_Sqlerrm);
    return 'exception happened';
    END call_myfuntion;
    end pkg_my_webservice;
    Here is the error
    SQL> /
    PKG_MY_WEBSERVICE.CALL_MYFUNTION('ABC','EFG')
    exception happened
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.or
    g/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchem
    a-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SO
    AP-ENV:Body><getGreeting xmlns="http://myServer:7001/p
    lsqlsvc/services/PlsqlS" SOAP-ENV:encodingStyle="http://sche
    mas.xmlsoap.org/soap/encoding/"><name xsi:type="string">abc<
    /name><location xsi:type="string">efg</location></getGreetin
    g></SOAP-ENV:Body></SOAP-ENV:Envelope>
    -12535ORA-12535: TNS:operation timed out
    Any help appreciated
    Thanks

    It was found out that the server port was not open from the data-tier.

  • Java works stand alone does not when called from PL/SQL

    I have this piece of code, which works as a standalone program: It takes in the en_var and returns a path.
    But it wont work when called from a store procedure the line of code p = rt.exec("echo "+envar); returns a path as a standalone program returns null when called from a Oracle store procedure.
    Thanks for any help just going around and round in circles.
    import java.util.*;
    class translate
    public static String translatePath(String envar)
    Runtime rt = Runtime.getRuntime();
    int bufSize = 4096;
    byte buffer[] = new byte[bufSize];
    String path = null;
    Process p = null;
    String os = null;
    String name = null;
    String home = null;
    String dir = null;
    SecurityManager sm = null;
    int len = 0;
    try
    System.out.println("Calling echo "+envar);
    os = System.getProperty("os.name");
    name = System.getProperty("user.name");
    home = System.getProperty("user.home");
    dir = System.getProperty("user.dir");
    sm = System.getSecurityManager();
    p = rt.exec("echo "+envar);
    BufferedInputStream bis = new BufferedInputStream(p.getInputStream());
    while ((len = bis.read(buffer, 0, bufSize)) != -1)
    System.out.write(buffer, 0, len);
    path = new String(buffer);
    //p.waitFor();
    bis.close();
    return path;
    catch(Exception e)
    System.out.println("Exception "+e);
    return "ProcessProblem";
    //path = "/rims/live/log";

    Still cant get it to work, it doesnt fall over anymore, but when I input $PATH, it will output $PATH instead of the path for $PATH i.e /rims/live: What does your program output please:
    Here is my code:
    import java.io.*;
    import java.util.*;
    class translate
         public static String translatePath(String envar)
              Runtime rt = Runtime.getRuntime();
              Process p = null;
              String echoOutput = null;
              int len = 0;
              try
                   System.out.println("Calling echo "+envar);
                   p = rt.exec(new String[]{"/bin/echo",envar});
                   InputStreamReader isr = new InputStreamReader(p.getInputStream());
                   BufferedReader br = new BufferedReader(isr);
                   echoOutput = br.readLine();
                   br.close();
                   isr.close();
                   return echoOutput;
              catch(Exception e)
                   System.out.println("Exception "+e);
                   return "ProcessProblem";
              //path = "/rims/live/log";
    Thanks for all your help so far.
    Tony

  • Shell script called from .sql fie in oracle concurrent manager

    Hi
    I am running a request set through Oracle concurrent manager.
    The manager calls a .sql file. The sql file internally calls a unix shell script.
    v_body VARCHAR2(10000);
    v_body is set as followed in the sql program.
    v_body := 'ATTENTION :' || CHR(10) || CHR(10) ||
    'Your invoice number ' || r_error_rec.invoice_num || ' cannot be paid at present due ' ||
              'to one of the following reasons:' || CHR(10) || CHR(10) ||
              ' - The Purchase Order number quoted on the invoice is invalid ' || CHR(10) ||
              ' - The Purchase Order number has not been quoted at all on the invoice' || CHR(10) ||
              ' - The Purchase Order number is missing on one or more of the lines on the invoice' ||
              CHR(10) || CHR(10) ||
              'To avoid any further payment delays, please advise us of the correct Purchase ' ||
              'Order number(s) by emailing ' || r_error_rec.sender || '. Please note that it is not ' ||
              'necessary to re-submit the invoice.' || CHR(10) || CHR(10) ||
              'If you do not know the Purchase Order number, please contact the employee ' ||
              'who ordered your goods/services for this number. For future reference please note that ' ||
              'it is the responsibility of the vendor to ensure that an approved Purchase Order ' ||
              'number is received before supplying goods/services to . The purchase order is ' ||
              'evidence that the order has been approved by management.' || CHR(10) || CHR(10) ||
              'This invoice will be held as pending until the valid Purchase Order number can be provided.' || CHR(10) || CHR(10) ||
              'Thank you,' || CHR(10) || CHR(10) || ' Accounts Payable' || CHR(10);
    The sql now calls a unix shell script as shown below.
              l_request_id := fnd_request.submit_request (
                                            'CFI',                                   'CFIECAPEMLSH',                         NULL,                              NULL,                              FALSE,                              r_error_rec.sender,                          v_recipient,                              v_ccrecipient,                          v_bccrecipient,                          v_subject,                                   v_body,                                   v_attachment     
    So here the problem i am facing is that the shell script is not getting called.
    If i keep v_body= 'Test' the shell script is called and program is working fine.
    Is it a problem with CHR(10) or the size limitation of v_body i dont know.
    I tried to keep v_body VARCHAR2(10000).
    Still it did not work.
    Plz help me if u know about this.

    You cannot have varchar2 > 4000.

  • Execute Unix script file using PL/SQL.

    Hi all,
    Is there a way to execute a PL/SQL procedure which call the Unix(AIX) OS script file.
    My version of Oracle is 7.3.
    Thanks.

    As Justin says, Java stored procedures is one way
    else if you dont know Java and are familiar with C,
    then you can create external routines in C
    and use them in procedure.
    Works with 8i and above( I believe)
    Cheers
    Ashwin N.

  • Web Service Call from PL/SQL

    Hi Gurus,
    I am calling a Web Service(RoadNet Application) from Oracle PL/SQL(11g Database). My code is working for simple xml type to get the response. But when I tried with a complex XML type, I am getting the response, but it does not have the complete output.
    Working Sample Code
    Here is the code and the calling block which I am using to call. This does not have any input parameters, just one output parameter.
    -----------------Start of the procedure----------------------------------------------------------------------
    create or replace
    PROCEDURE ORACLE_TO_ROADNET_PROC_TEST (p_input IN NUMBER,
                                      l_out_return OUT NUMBER)
    AS
      l_service          UTL_DBWS.service;--TransportationWebService.Service?? what is DB data service?
      l_call             UTL_DBWS.call;--TransportationWebService.
      l_wsdl_url         VARCHAR2(32767);
      l_namespace        VARCHAR2(32767);
      l_soap_env         VARCHAR2(32767);
      l_soap_enc         VARCHAR2(32767);
      l_instance         VARCHAR2(32767);
      l_schema           VARCHAR2(32767);
      l_service_qname    UTL_DBWS.qname;
      l_port_qname       UTL_DBWS.qname;
      l_operation_qname  UTL_DBWS.qname;
      l_xmltype_in       SYS.XMLTYPE;
      l_xmltype_out      SYS.XMLTYPE;
    l_xsdoc     DBMS_XMLDOM.DOMDocument;
      l_dn        DBMS_XMLDOM.DOMNode;
      l_return           NUMBER;
    BEGIN
      l_wsdl_url        := 'http://10.81.8.39:80/TransportationWebService.wsdl';
      l_namespace       := 'http://www.roadnet.com/RTS/TransportationSuite/TransportationWebService';
      l_service_qname   := UTL_DBWS.to_qname(l_namespace, 'TransportationWebService');
      l_port_qname      := UTL_DBWS.to_qname(l_namespace, 'TransportationWebService');
      l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'VersionInformation');
      l_service := UTL_DBWS.create_service (
        wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
        service_name           => l_service_qname);
      dbms_output.put_line('Created the Web Service');
      l_call := UTL_DBWS.create_call (
        service_handle => l_service,
        port_name      => l_port_qname,
        operation_name => l_operation_qname);
        dbms_output.put_line('Created the Web Service Operation');
    --UTL_DBWS.set_target_endpoint_address(l_call, 'http://www.roadnet.com/RTS/TransportationSuite/TransportationWebService/');
    UTL_DBWS.set_property(l_call, 'USERNAME', 'SAE');
    UTL_DBWS.set_property(l_call, 'PASSWORD', 'CxzMte22');
    --UTL_DBWS.set_property(l_call, 'DOMAIN', 'rhea');
    UTL_DBWS.set_property(l_call, 'OPERATION_STYLE', 'document');
    UTL_DBWS.set_property(l_call, 'SOAPACTION_USE', 'true');
    UTL_DBWS.set_property(l_call, 'SOAPACTION_URI', 'http://www.roadnet.com/RTS/TransportationSuite/TransportationWebService/');
    l_xmltype_in := SYS.XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
        <VersionInformation xmlns="' || l_namespace || '">
        <parameters>' || p_input || '</parameters>
        </VersionInformation>');
        dbms_output.put_line('Prepared the XML String to pass');
      l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call ,
                                       request     => l_xmltype_in);
    dbms_output.put_line('Invoked the Web Services');
      UTL_DBWS.release_call (call_handle => l_call);
      UTL_DBWS.release_service (service_handle => l_service);
    dbms_output.put_line('Before Reading the XML output data');
    l_return := l_xmltype_out.extract(''//ns1:VersionInformationResponse/ns1:version/text()','xmlns:ns1="http://www.roadnet.com/RTS/TransportationSuite/TransportationWebService">').getNumberVal();
    --dbms_output.put_line('After Reading the XML output data'||l_xmltype_out);
    --dbms_output.put_line('l_return'||l_return);
    -- l_out_return := l_return;
      --dbms_output.put_line('l_dn '||l_dn);
    END ORACLE_TO_ROADNET_PROC_TEST;
    -------------------------------End Of Procedure----------------------------------------------------
    ---Call to Web Service----------------------------------------
    declare
    x_return NUMBER;
    Begin
    Oracle_to_RoadNet_proc_test (p_input => 1,
                           l_out_return => x_return);
    dbms_output.put_line(  ' x_return'||x_return);                   
    end;         
    -----------------------------------------------------------------------------Sample Code Which is not giving output
    Here is the other one which is not returing the right output. It got 3 input parameters and multiple output parameters, looks like it is not reading the inputs and not able to get the response.
    -----------------------Start of the procedure---------------------------------------------
    create or replace
    PROCEDURE ORACLE_TO_ROADNET_PROC(p_region_id IN NUMBER,
                                     p_location_type NUMBER,
                                     p_location_id   NUMBER,
                                     l_out_return OUT varchar2)
    AS
      l_service          UTL_DBWS.service;
      l_call             UTL_DBWS.call;
      l_wsdl_url         VARCHAR2(32767);
      l_namespace        VARCHAR2(32767);
      l_soap_env         VARCHAR2(32767);
      l_soap_enc         VARCHAR2(32767);
      l_instance         VARCHAR2(32767);
      l_schema           VARCHAR2(32767);
      l_service_qname    UTL_DBWS.qname;
      l_port_qname       UTL_DBWS.qname;
      l_operation_qname  UTL_DBWS.qname;
      l_xmltype_in       SYS.XMLTYPE;
      l_xmltype_out      SYS.XMLTYPE;
      l_xsdoc     DBMS_XMLDOM.DOMDocument;
      l_dn        DBMS_XMLDOM.DOMNode;
      l_locationinfo      varchar2(100);
    BEGIN
      l_wsdl_url        := 'http://10.81.8.39:80/TransportationWebService.wsdl';
      l_namespace       := 'http://www.roadnet.com/RTS/TransportationSuite/TransportationWebService';
      l_service_qname   := UTL_DBWS.to_qname(l_namespace, 'TransportationWebService');
      l_port_qname      := UTL_DBWS.to_qname(l_namespace, 'TransportationWebService');
      l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'RetrieveLocationByIdentity');
      l_service := UTL_DBWS.create_service (
        wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
        service_name           => l_service_qname);
      dbms_output.put_line('Created the Web Service');
      l_call := UTL_DBWS.create_call (
        service_handle => l_service,
        port_name      => l_port_qname,
        operation_name => l_operation_qname);
        dbms_output.put_line('Created the Web Service Operation');
    --UTL_DBWS.set_target_endpoint_address(l_call, 'http://www.roadnet.com/RTS/TransportationSuite/TransportationWebService/');
    UTL_DBWS.set_property(l_call, 'USERNAME', 'SAE');
    UTL_DBWS.set_property(l_call, 'PASSWORD', 'CxzMte22');
    --UTL_DBWS.set_property(l_call, 'DOMAIN', 'rhea');
    UTL_DBWS.set_property(l_call, 'OPERATION_STYLE', 'document');
    UTL_DBWS.set_property(l_call, 'SOAPACTION_USE', 'true');
    UTL_DBWS.set_property(l_call, 'SOAPACTION_URI', 'http://www.roadnet.com/RTS/TransportationSuite/TransportationWebService/');
    l_xmltype_in := SYS.XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
        <RetrieveLocationByIdentity xmlns="' || l_namespace || '">
        <identity>
        <regionID>' || p_region_id || '</regionID>
        <locationType>' || p_location_type || '</locationType>
        <locationID>' || p_location_id || '</locationID>
        </identity>
        </RetrieveLocationByIdentity>');
        dbms_output.put_line('Prepared the XML String to pass');
      l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call ,
                                       request     => l_xmltype_in);
    dbms_output.put_line('Invoked the Web Services');
      UTL_DBWS.release_call (call_handle => l_call);
      UTL_DBWS.release_service (service_handle => l_service);
    dbms_output.put_line('Before Reading the XML output data');
    insert into  utldbws.EBH_XMLDATA
    values
    (l_xmltype_out, sysdate);
    commit;
    select extractvalue(l_xmltype_out,'//ns1:RetrieveLocationByIdentityResponse/ns1:location/ns1:description', 'xmlns:ns1="http://www.roadnet.com/RTS/TransportationSuite/TransportationWebService">' )
    into l_locationinfo
    from dual;
    l_out_return := l_locationinfo;
    dbms_output.put_line('l_locationinfo '||l_locationinfo);
    END ORACLE_TO_ROADNET_PROC;
    ----------------------End Of the Procedure-------------------------------------------------------
    ----------------Calling Block------------------------
    DECLARE
      p_region_id VARCHAR2(50);
      p_location_type VARCHAR2(50);
      p_location_id VARCHAR2(50);
      L_OUT_RETURN VARCHAR2(100);
    BEGIN
      ORACLE_TO_ROADNET_PROC(
        p_region_id => '310',
        p_location_type => '200',
        p_location_id => '499022',
        L_OUT_RETURN => L_OUT_RETURN
      DBMS_OUTPUT.PUT_LINE('L_OUT_RETURN = ' || L_OUT_RETURN);
    END;
    -----------------------------------------------------------------------------------------------Looks like this is not reading the input parameters and not returning the output but execution is successful. Please go throguh this and let me know, if I am missing anything. If you have worked on similar Web Services, please let me know.
    Thanks in advance!
    Ravi
    Edited by: BluShadow on 16-May-2013 15:19
    added {noformat}{noformat} tags for readability.  Please read the FAQ: {message:id=9360002} and do this yourself in future posts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    1006367 wrote:
    I am calling a Web Service(RoadNet Application) from Oracle PL/SQL(11g Database). I would not use UTL_DBWS. I had to do another web service interface recently, had a look at UTL_DBWS, and again decided not to use it. Simply put. It lacks.
    I use SOAPUI (OpenSource/free version) to interrogate the web service (read wsdl) and format a sample SOAP envelope to use.
    I then use UTL_HTTP and code a HTML POST for that web service, using the SOAPUI generated envelope as template. Supporting WSSE is also not a problem (easily done using PL/SQL).
    I posted an example of my approach in {message:id=10448611} almost a year ago - and recent experience having looked at both UTL_DBWS and the plan vanilla PL/SQL HTTP approach, I still recommend the latter.

  • Capturing log files from multiple .ps1 scripts called from within a .bat file

    I am trying to invoke multiple instances of a powershell script and capture individual log files from each of them. I can start the multiple instances by calling 'start powershell' several times, but am unable to capture logging. If I use 'call powershell'
    I can capture the log files, but the batch file won't continue until that current 'call powershell' has completed.
    ie.  within Test.bat
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > a.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > b.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > c.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > d.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > e.log 2>&1
    timeout /t 60
    start powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > f.log 2>&1
    the log files get created but are empty.  If I invoke 'call' instead of start I get the log data, but I need them to run in parallel, not sequentially.
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > a.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > b.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > c.log 2>&1
    timeout /t 60
    call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > d.log 2>&1
    timeout /t 60call powershell . \Automation.ps1 %1 %2 %3 %4 %5 %6 > e.log 2>&1
    Any suggestions of how to get this to work?

    Batch files are sequential by design (batch up a bunch of statements and execute them). Call doesn't run in a different process, so when you use it the batch file waits for it to exit. From CALL:
    Calls one batch program from another without stopping the parent batch program
    I was hoping for the documentation to say the batch file waits for CALL to return, but this is as close as it gets.
    Start(.exe), "Starts a separate window to run a specified program or command". The reason it runs in parallel is once it starts the target application start.exe ends and the batch file continues. It has no idea about the powershell.exe process
    that you kicked off. Because of this reason, you can't pipe the output.
    Update: I was wrong, you can totally redirect the output of what you run with start.exe.
    How about instead of running a batch file you run a PowerShell script? You can run script blocks or call individual scripts in parallel with the
    Start-Job cmdlet.
    You can monitor the jobs and when they complete, pipe them to
    Receive-Job to see their output. 
    For example:
    $sb = {
    Write-Output "Hello"
    Sleep -seconds 10
    Write-Output "Goodbye"
    Start-Job -Scriptblock $sb
    Start-Job -Scriptblock $sb
    Here's a script that runs the scriptblock $sb. The script block outputs the text "Hello", waits for 10 seconds, and then outputs the text "Goodbye"
    Then it starts two jobs (in this case I'm running the same script block)
    When you run this you receive this for output:
    PS> $sb = {
    >> Write-Output "Hello"
    >> Sleep -Seconds 10
    >> Write-Output "Goodbye"
    >> }
    >>
    PS> Start-Job -Scriptblock $sb
    Id Name State HasMoreData Location Command
    1 Job1 Running True localhost ...
    PS> Start-Job -Scriptblock $sb
    Id Name State HasMoreData Location Command
    3 Job3 Running True localhost ...
    PS>
    When you run Start-Job it will execute your script or scriptblock in a new process and continue to the next line in the script.
    You can see the jobs with
    Get-Job:
    PS> Get-Job
    Id Name State HasMoreData Location Command
    1 Job1 Running True localhost ...
    3 Job3 Running True localhost ...
    OK, that's great. But we need to know when the job's done. The Job's Status property will tell us this (we're looking for a status of "Completed"), we can build a loop and check:
    $Completed = $false
    while (!$Completed) {
    # get all the jobs that haven't yet completed
    $jobs = Get-Job | where {$_.State.ToString() -ne "Completed"} # if Get-Job doesn't return any jobs (i.e. they are all completed)
    if ($jobs -eq $null) {
    $Completed=$true
    } # otherwise update the screen
    else {
    Write-Output "Waiting for $($jobs.Count) jobs"
    sleep -s 1
    This will output something like this:
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    Waiting for 2 jobs
    When it's done, we can see the jobs have completed:
    PS> Get-Job
    Id Name State HasMoreData Location Command
    1 Job1 Completed True localhost ...
    3 Job3 Completed True localhost ...
    PS>
    Now at this point we could pipe the jobs to Receive-Job:
    PS> Get-Job | Receive-Job
    Hello
    Goodbye
    Hello
    Goodbye
    PS>
    But as you can see it's not obvious which script is which. In your real scripts you could include some identifiers to distinguish them.
    Another way would be to grab the output of each job one at a time:
    foreach ($job in $jobs) {
    $job | Receive-Job
    If you store the output in a variable or save to a log file with Out-File. The trick is matching up the jobs to the output. Something like this may work:
    $a_sb = {
    Write-Output "Hello A"
    Sleep -Seconds 10
    Write-Output "Goodbye A"
    $b_sb = {
    Write-Output "Hello B"
    Sleep -Seconds 5
    Write-Output "Goodbye B"
    $job = Start-Job -Scriptblock $a_sb
    $a_log = $job.Name
    $job = Start-Job -Scriptblock $b_sb
    $b_log = $job.Name
    $Completed = $false
    while (!$Completed) {
    $jobs = Get-Job | where {$_.State.ToString() -ne "Completed"}
    if ($jobs -eq $null) {
    $Completed=$true
    else {
    Write-Output "Waiting for $($jobs.Count) jobs"
    sleep -s 1
    Get-Job | where {$_.Name -eq $a_log} | Receive-Job | Out-File .\a.log
    Get-Job | where {$_.Name -eq $b_log} | Receive-Job | Out-File .\b.log
    If you check out the folder you'll see the log files, and they contain the script contents:
    PS> dir *.log
    Directory: C:\Users\jwarren
    Mode LastWriteTime Length Name
    -a--- 1/15/2014 7:53 PM 42 a.log
    -a--- 1/15/2014 7:53 PM 42 b.log
    PS> Get-Content .\a.log
    Hello A
    Goodbye A
    PS> Get-Content .\b.log
    Hello B
    Goodbye B
    PS>
    The trouble though is you won't get a log file until the job has completed. If you use your log files to monitor progress this may not be suitable.
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Refcursor not returning rows when called from non SQL*Plus IDE or other

    Hi all,
    I have a very weird problem.
    We have recently performed a minor upgrade to our oracle database and are now using:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for Linux: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    5 rows selected.We have a crystal report selecting data from a refcursor returned by a stored procedure.
    The stored procedure updates data when called as well as returning the refcursor in question.
    Observe the following test scenario executed in SQL*Plus:
    SQL> create table testtab (teststr varchar2(100));
    Table created.
    Elapsed: 00:00:00.00
    SQL> insert into testtab values ('X');
    1 row created.
    Elapsed: 00:00:00.00
    SQL> create or replace procedure testtabproc (p_listcur in out sys_refcursor)
      2  as
      3  begin
      4 
      5     open p_listcur for
      6        select *
      7          from testtab
      8         where teststr = 'X';
      9 
    10 
    11     update testtab
    12        set teststr = 'Y';
    13 
    14        commit;
    15 
    16  end;
    17  /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> declare
      2 
      3  v_list_cur sys_refcursor;
      4 
      5  type t_out_rec is record (teststr varchar2(100) );
      6 
      7 
      8 
      9  v_out_rec t_out_rec;
    10 
    11  v_rec_count   number := 0;
    12  v_count_limit number := 10000;
    13 
    14  begin
    15 
    16  dbms_output.put_line('about to call proc');
    17
    18  testtabproc(v_list_cur);
    19 
    20  dbms_output.put_line('about to fetch records');
    21 
    22  fetch v_list_cur into v_out_rec;
    23  while v_list_cur%found loop
    24     v_rec_count := v_rec_count + 1;
    25     if v_rec_count <= v_count_limit then
    26       dbms_output.put_line(v_out_rec.teststr);
    27     end if;
    28  fetch v_list_cur into v_out_rec;
    29  end loop;
    30  dbms_output.put_line('complete. selected '||v_rec_count||' records.');
    31 
    32 
    33  end;
    34  /
    about to call proc                                                                                                                 
    about to fetch records                                                                                                             
    X                                                                                                                                  
    complete. selected 1 records.                                                                                                      
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select * from testtab;
    TESTSTR
    Y
    1 row selected.
    Elapsed: 00:00:00.00
    SQL> as you can see, the cursor returns data and the table is updated.
    now, our problem is with crystal and also when I use the same test case via another IDE like TOAD.
    No data is returned from the list but the table is still updated.
    We suspect that something is happening that is causing the table to be updated before the refcursor is opened, or at least before the predicates are applied.
    has anyone else encountered this problem before?

    Tubby wrote:
    WhiteHat wrote:
    nope - it works from sqlplus itermitantly (i.e. we always get the debug output but the cursor only sometimes fetches the rows).
    it is almost as if the commit is being executed before the cursor is opened.
    I still havn't been able to reproduce it except with the actual scenario that I am working with...Is the code you are dealing with exactly the same as the skeleton you've posted in your original post? Do you perhaps have a generic exception catcher in there somewhere (perhaps catching and hiding an ORA-01555) when the cursor is being fetched?
    Not that i expect it to make any difference, but i'm curious as to why you've declared your cursor as IN / OUT ?
    p_listcur in out sys_refcursor
    the code structure in the real example is almost identical to that test case I produced - the exception handler is only catering for no_data_found, all other errors should be raised as normal.
    edit: sorry I forgot to add - it's in/out because apparently that's what crystal reports needs in order to use the refcursor..... I'm not a crystal guy so I can't be any more specific than that sorry......
    Edited by: WhiteHat on Oct 11, 2010 9:34 AM

Maybe you are looking for