Notification via PL/SQL procedures

1. Has anybody done notification via PL/SQL procedures in EM release 2?
2. How do you setup Critical Alerts to be send to Pager and Warnings to Email?
Please provide step by step it would help.
Thanks
George

I have created PROCEDURE LOG_CRITICAL_ALERTS ok, but how do I use this new method PL/SQL to send Pager Alert?

Similar Messages

  • Getting SOAException while calling SOA web service via pl/sql procedure

    Hi All,
    I created a 'Helloworld' BPEL process and successfuly deployed it. I tested it in the WLS and it is working. Now I wrote a pl/sql procedure which calls this 'HelloWorld' bpel process. When ran this procedure it throw me an error
    GetPayload: resp3 IS NULL
    <HTML><HEAD><TITLE>Web Service</TITLE></HEAD><BODY><H1>Bad Request</H1><PRE>javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected character &#39;&#60;&#39; &#40;code 60&#41; excepted space, or &
    #62;&#39; or &#34;/&#62;&#34;
    at [row,col {unknown&#45;source}]: [1,120]</PRE></BODY></HTML>
    null response
    GetPayload: resp3 IS NULL
    <HTML><HEAD><TITLE>Web Service</TITLE></HEAD><BODY><H1>Bad Request</H1><PRE>javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected character &#39;&#60;&#39; &#40;code 60&#41; excepted space, or &
    #62;&#39; or &#34;/&#62;&#34;
    at [row,col {unknown&#45;source}]: [1,120]</PRE></BODY></HTML>
    null response
    Please suggest.
    WSDL - http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep?WSDL
    procedure code is as below:
    Create or Replace FUNCTION GetPayload(
    p_Payload IN VARCHAR2)
    RETURN VARCHAR2 IS
    soap_request VARCHAR2(30000);
    soap_respond VARCHAR2(30000);
    http_req UTL_HTTP.REQ;
    http_resp UTL_HTTP.RESP;
    resp XMLTYPE;
    response VARCHAR2(30000) := '';
    l_detail VARCHAR2(30000);
    i INTEGER;
    l_xsl_nonamespace VARCHAR2(640) := '<?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="comment()|processing-instruction()|/"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="*"> <xsl:element name="{local-name()}"> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:template> <xsl:template match="@*"> <xsl:choose> <xsl:when test="name() != ''xmlns''"> <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:when> </xsl:choose> </xsl:template></xsl:stylesheet>';
    namespace VARCHAR2(128) := 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP';
    endpoint VARCHAR2(128) := 'http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep';
    BEGIN
    soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||'<SOAP-ENV:Envelope '||'xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"'||'<SOAP-ENV:Body>'||'<'||namespace||'>'||'<ProcessRequest>'||'<input'||namespace||'>'||p_Payload||'</input>'||'</ProcessRequest>'||'</SOAP-ENV:Body>'||'</SOAP-ENV:Envelope>';
    http_req := utl_http.begin_request( endpoint, 'POST', 'HTTP/1.1');
    utl_http.set_header(http_req , 'Content-Type' , 'text/xml');
    -- dealing with plain text in XML documents
    utl_http.set_header(http_req , 'Content-Length' , lengthb(soap_request));
    utl_http.set_header(http_req , 'SOAPAction' , 'process'); -- required to specify a SOAP communication
    utl_http.write_text(http_req, soap_request);
    http_resp := utl_http.get_response(http_req);
    utl_http.read_text(http_resp, soap_respond);
    utl_http.end_response(http_resp);
    resp:= XMLType.createXML(soap_respond);
    IF (instr(resp.getStringVal(), 'ERROR:') > 0)THEN
    raise_application_error ( -20999, 'GetHelloWorldPayload: Failed! '||p_Payload);
    END IF;
    resp := resp.extract('/soap:Envelope/soap:Body/child::node()' , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' );
    -- Remove namespaces
    SELECT XMLTransform(resp, xmlType(l_xsl_nonamespace)) INTO resp FROM dual;
    -- resp := resp.extract('/ProcessResponse/child::node()', 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP');
    IF (resp IS NULL)THEN
    dbms_output.put_line('GetPayload: resp3 IS NULL');
    ELSE
    dbms_output.put_line('GetPayload: resp3 ' ||resp.getStringVal());
    END IF;
    i:=0;
    LOOP
    dbms_output.put_line(SUBSTR(soap_respond,1+ i*255,250));
    i := i+1;
    IF i*250> LENGTH(soap_respond) THEN
    EXIT;
    END IF;
    END LOOP;
    IF (resp IS NULL)THEN
    response := 'null response';
    ELSE
    response := REPLACE( REPLACE( REPLACE( resp.getStringVal(), '<', '<') , '>', '>') , '"', '"');
    END IF;
    RETURN response;
    END GetPayload;
    /

    vladodias thanks for the reply. I went through the link before also but i am not comfortable with the utl_dbws that's why i am following utl_http.
    I also changed my procedure now i am not getting any error but it is not printing the output as well. New procedure is as below.
    I tried 'set serveroutput on size 1000000;' also but still not working.
    Create or Replace FUNCTION GetPayload(
    p_Payload IN VARCHAR2)
    RETURN VARCHAR2 IS
    soap_request VARCHAR2(30000);
    soap_respond VARCHAR2(30000);
    http_req UTL_HTTP.REQ;
    http_resp UTL_HTTP.RESP;
    resp XMLTYPE;
    response VARCHAR2(30000) := '';
    l_detail VARCHAR2(30000);
    i INTEGER;
    l_xsl_nonamespace VARCHAR2(3000) := '<?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="comment()|processing-instruction()|/">
    <xsl:copy>
    <xsl:apply-templates/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="*">
    <xsl:element name="{local-name()}">
    <xsl:apply-templates select="@*|node()"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="@*">
    <xsl:choose>
    <xsl:when test="name() != ''xmlns''">
    <xsl:attribute name="{local-name()}">
    <xsl:value-of select="."/>
    </xsl:attribute>
    </xsl:when>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>';
    namespace VARCHAR2(128) := 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP';
    endpoint VARCHAR2(128) := 'http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep';
    BEGIN
    soap_request:= '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bpel="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP">
    <soapenv:Header/>
    <soapenv:Body>
    <bpel:process>
    <bpel:input>test</bpel:input>
    </bpel:process>
    </soapenv:Body>
    </soapenv:Envelope>';
    http_req := utl_http.begin_request( endpoint, 'POST', 'HTTP/1.1');
    utl_http.set_header(http_req , 'Content-Type' , 'text/xml');
    -- dealing with plain text in XML documents
    utl_http.set_header(http_req , 'Content-Length' , lengthb(soap_request));
    utl_http.set_header(http_req , 'SOAPAction' , 'process'); -- required to specify a SOAP communication
    utl_http.write_text(http_req, soap_request);
    http_resp := utl_http.get_response(http_req);
    utl_http.read_text(http_resp, soap_respond);
    utl_http.end_response(http_resp);
    resp:= XMLType.createXML(soap_respond);
    IF (instr(resp.getStringVal(), 'ERROR:') > 0)THEN
    raise_application_error ( -20999, 'GetHelloWorldPayload: Failed! '||p_Payload);
    END IF;
    resp := resp.extract('/soap:Envelope/soap:Body/child::node()' , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' );
    -- Remove namespaces
    SELECT XMLTransform(resp, xmlType(l_xsl_nonamespace)) INTO resp FROM dual;
    -- resp := resp.extract('/ProcessResponse/child::node()', 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP');
    IF (resp IS NULL)THEN
    dbms_output.put_line('GetPayload: resp3 IS NULL');
    ELSE
    dbms_output.put_line('GetPayload: resp3 ' ||resp.getStringVal());
    END IF;
    i:=0;
    LOOP
    dbms_output.put_line(SUBSTR(soap_respond,1+ i*255,250));
    i := i+1;
    IF i*250> LENGTH(soap_respond) THEN
    EXIT;
    END IF;
    END LOOP;
    IF (resp IS NULL)THEN
    response := 'null response';
    ELSE
    response := REPLACE( REPLACE( REPLACE( resp.getStringVal(), '<', '<') , '>', '>') , '"', '"');
    END IF;
    RETURN response;
    END GetPayload;
    /

  • Retrieve online file as CSV via HTTPS using PL/SQL procedure

    Hi all,
    Situation:
    Server A (not ORACLE)_: accesed via URL, generates dynamically a CSV file and returns to the requestor.
    Server B (ORACLE)_: which runs the PL/SQL script. It is the requestor. Read the CSV and store it within ORACLE.
    (1) I want to connect from Server B (ORACLE) to an external URL via HTTPS which generates dynamically the CSV file. Subdomain.domain it is the Server A which contains this CSV file.
    https://dubdomain.domain/csv_generator.php?query=q1
    (2) This file is downloaded to the Server B (ORACLE). A PL/SQL script executed in this machine do the task.
    (3) After that, I load this CSV to an ORACLE table which a common CSV PL/SQL parser.
    Doubts:
    Is it possible to retrieve an online file (a CSV) dynamically created and hosted in a third party server (Not ORACLE) via HTTPS using a PL/SQL procedure executed in a ORACLE server? If the answer is yes, what technology could I use? Any ideas?
    Thanks in advance,
    Yago

    An CSV example in {message:id=10158148}.
    For https, two actions are needed in addition.
    Firstly, the certificate of the https web server needs to be loaded in an Oracle Wallet on your database server. The wallet will have a specific directory location on the server, and will be protected by a password.
    Secondly, the PL/SQL procedure making web call, needs to open the wallet (using <i>UTL_HTTP.set_wallet</i>) using the location and password. Example of that in {message:id=10820182}.

  • Do I run a shell script (bsh) via PL/SQL stored procedure?

    Hello guys,
    Do I run a shell script (bsh) via PL/SQL stored procedure?
    For example:
    procedure X is
    (variables)
    begin
    -- Read file data
    vFileHandle := utl_file.fopen('/mnt/novell/', 'file.txt','r');
    exception
    when 'INVALID READ FILE' then
    (I've to try running script to mount a Novell partition.);
    end;
    I've to installed Oracle 9.0.1 on Suse Linux.
    Please, any ideas or hints ...
    Thx and regards.

    You might be able to us the HOST command, I think you'd have to run it via dbms_sql, check this page for more details, not sure if it'll be of help but its worth a try..
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a82950/ch8.htm
    Cheers
    Rob

  • Passing a list into a sql procedure via a unix shell.

    9.2.0.6
    for some dumb reason we cannot use java to do this task.
    anyways
    I need to build a list of all file in a particular directory. The list could be zero to very very long. I would like to be able to pass that list to a PL/SQL procedure.
    this is in unix
    I think I could do something like
    var=f1,f2,f3,f4
    sqlplus blah/blah $var
    exec my_proc(&var);
    I guess that would handle up to 32k in length. It would be up to me to parse the list.
    I am really looking for an way to do this a bit slicker.. like with a ref cursor but I seem to be getting stuck.
    Thanks

    Some examples here :
    Re: How to pass Character parameter
    Nicolas.

  • Call procedure via dynamic sql

    Dear Oracle experts,
    I try to call several stored procedures from several packages within the function below.
    These stored procedures all own a procedure returning a version string.
    I would like to write a function which gets a schemaname (for the schema which contains the package), and a packagename which calls a procedure within that package (all packages have a procedure called sp_packageversion which returns a versionstring) and returns the received versionstring.
    But my codes doesn't work because the dynamic sql doesn't call the procedure.
    What am I doing the wrong way ?
    function func_GetPackageVersion(prm_ecs_Schemaname varchar2, prm_objectname user_procedures.object_name%type
    ) return varchar2 is
    sqlstmt varchar2(100);
    objectversion varchar2(50);
    begin
    sqlstmt := prm_ecs_Schemaname || '.' || prm_objectname || '.sp_packageversion(objectversion)';
    execute immediate sqlstmt;
    return objectversion;
    end func_GetECSPackageVersion;
    Hope someone can help.
    Best regards,
    Daniel

    test@ora>
    test@ora>
    test@ora> --
    test@ora> -- the package
    test@ora> --
    test@ora> create or replace package my_pkg
      2  as
      3    procedure sp_packageversion (objectversion out varchar2);
      4  end;
      5  /
    Package created.
    test@ora>
    test@ora> create or replace package body my_pkg
      2  as
      3    procedure sp_packageversion (objectversion out varchar2)
      4    is
      5    begin
      6      objectversion := 'VERSION IS 10.1.2.3';
      7    end;
      8  end;
      9  /
    Package body created.
    test@ora>
    test@ora> --
    test@ora> -- the function
    test@ora> --
    test@ora> create or replace function func_GetPackageVersion (
      2    prm_ecs_Schemaname varchar2,
      3    prm_objectname     user_procedures.object_name%type
      4  )
      5  return varchar2
      6  is
      7    sqlstmt varchar2(4000);
      8    objectversion varchar2(50);
      9  begin
    10    execute immediate 'BEGIN '|| prm_ecs_Schemaname ||'.' || prm_objectname || '.sp_packageversion(:x); END; ' USING OUT objectversion;
    11    return objectversion;
    12  end;
    13  /
    Function created.
    test@ora>
    test@ora> --
    test@ora> -- anonymous pl/sql block for the function
    test@ora> --
    test@ora> declare
      2    p_ecs_Schemaname  varchar2(30) := 'TEST';
      3    p_objectname      user_procedures.object_name%type := 'MY_PKG';
      4    v_return_str      varchar2(32767);
      5  begin
      6    v_return_str := func_GetPackageVersion (p_ecs_Schemaname, p_objectname);
      7    dbms_output.put_line(v_return_str);
      8  end;
      9  /
    VERSION IS 10.1.2.3
    PL/SQL procedure successfully completed.
    test@ora>
    test@ora>
    test@ora>HTH
    isotope

  • PL/SQL WEB Toolkit: Using BUTTON to execute PL/SQL procedure

    I am trying to execute a PL/SQL procedure with a "SUBMIT" button from a WEB page. I have several URLs that execute perfectly, but I do not want endusers to have to type the URL themselves. I want to display a web page with multiple URLs in a drop_down list. User chooses a member of the list, clicks the "SUBMIT" buttom and that specific URL executes and produces the proper result. I am NOT a web developer, but this is what I've written sofar:
    CREATE OR REPLACE PROCEDURE html_list
    IS
    BEGIN
    HTP.PRINT ('<html>');
    HTP.PRINT ('<head>');
    HTP.PRINT ('<meta http-equiv="Content-Type" content="text/html">');
    HTP.PRINT ('<title>Title of the HTML File</title>');
    HTP.PRINT ('</head>');
    HTP.PRINT ('<body TEXT="#000000" BGCOLOR="#FFFFFF">');
    HTP.PRINT ('<h1>List of Valid URLs</h1>');
    HTP.PRINT ('<p>Choose your desired URL from the list below.');
    HTP.PRINT ('<FORM method="post" action="WHATEVER_COUNTS_WEB">');
    HTP.PRINT ('<FORM method="post" action="REQUEST_OBJECTS?PARAM1=MY_SCHEMA_ID">');
    HTP.PRINT ( '<SELECT name="URL">
    <option value="http://asai01.ffxlab.net:8080/me_epg_dad/WHATEVER_COUNTS_WEB">Count of Rows in Whatever Tables
    <option value="http://asai01.ffxlab.net:8080/me_epg_dad/REQUEST_OBJECTS?PARAM1=ME">Request Objects for MY_SCHEMA_ID
    <input type="submit" value="Submit"/>
    </SELECT>');
    HTP.PRINT ('</FORM>');
    HTP.PRINT ('</body>');
    HTP.PRINT ('</html>');
    END;
    Any help would be greatly appreciated. I've been writing PL/SQL code since 1989, but have never had to execute code via a WEB page until this week.
    Thanks so much

    Hi,
    Welcome to Oracle Forums!
    Please acquaint yourself with the FAQ and forum etiquette if you haven't already done so.
    Always post code snippets enclosed in a pair of &#123;code&#125; tags as explained in FAQ
    This Forum is dedicated to Oracle Forms. Unfortunately there is no Forum for WebToolKit that I know of. The closest is Oracle Application Express (APEX).
    If you objective is to have the User Navigate to the URL clicked then the easiest way is to use anchor tag with href attribute
    CREATE OR REPLACE PROCEDURE html_list
    IS
    BEGIN
    HTP.PRINT ('<html>');
    HTP.PRINT ('<head>');
    HTP.PRINT ('<meta http-equiv="Content-Type" content="text/html">');
    HTP.PRINT ('<title>Title of the HTML File</title>');
    HTP.PRINT ('</head>');
    HTP.PRINT ('<body TEXT="#000000" BGCOLOR="#FFFFFF">');
    HTP.PRINT ('<h1>List of Valid URLs</h1>');
    HTP.PRINT ('<p>Choose your desired URL from the list below.</p>');
    HTP.PRINT ('<a href="http://asai01.ffxlab.net:8080/me_epg_dad/WHATEVER_COUNTS_WEB" target="_blank">Count of Rows in Whatever Tables</a>');
    HTP.PRINT('<a "http://asai01.ffxlab.net:8080/me_epg_dad/REQUEST_OBJECTS?PARAM1=ME" target="_blank">Request Objects for MY_SCHEMA_ID</a>');
    HTP.PRINT ('<FORM method="post" action="WHATEVER_COUNTS_WEB">');
    HTP.PRINT ('<FORM method="post" action="REQUEST_OBJECTS?PARAM1=MY_SCHEMA_ID">');
    HTP.PRINT ( '<SELECT name="URL">
    <option value="http://asai01.ffxlab.net:8080/me_epg_dad/WHATEVER_COUNTS_WEB">Count of Rows in Whatever Tables
    <option value="http://asai01.ffxlab.net:8080/me_epg_dad/REQUEST_OBJECTS?PARAM1=ME">Request Objects for MY_SCHEMA_ID
    <input type="submit" value="Submit"/>
    </SELECT>');
    HTP.PRINT ('</FORM>'); */
    HTP.PRINT ('</body>');
    HTP.PRINT ('</html>');
    END;Change the target attribute to suite your needs. More here http://www.w3schools.com/tags/att_a_target.asp
    Or, maybe explore Apex !
    Cheers,

  • How to access IFS document contents in PL/SQL procedure ?

    I am interested in using IFS as a way to load documents
    (PDF, HTML, RFT, text...) in an Oracle database table, and
    then access the table via a regular application Server.
    I understand that the right way to do this is via a Java API
    mapped on top of IFS.
    But we already have a fairly sophisticated web application using
    Java and PL/SQL procedures so that I would ideally need
    to write a PL/SQL procedure such as :
    function get_document (ifs_file_name in varchar, ifs_file_path in varchar) return clob
    For this I need to outline how to query the IFS schema using SQL.
    Any idea which table to query ?
    Have a nice day

    Many thanks to Chris Schneider : it works. Withing a few hours
    I was able to make a servlet with a file name as a parameter which sends back
    the file contents (in our case its a PDF file).
    Here is a sample servlet which uses this access scheme :
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class TestIFS extends HttpServlet
    * Handle the GET and HEAD methods by building a simple web page.
    * HEAD is just like GET, except that the server returns only the
    * headers (including content length) not the body we write.
    public void doGet (HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
    //PrintWriter out;
    String title = "Test d'acchs IFS";
    // set content type and other response header fields first
    response.setContentType("application/pdf");
    // then write the data of the response
              ServletOutputStream outbin = response.getOutputStream();
              String theQuery=
         "SELECT "+
         " odm_publicobject.name object_name"+
         ", odmm_contentstore.id content_id"+
         ", odm_format.mimetype"+
         ", odmm_contentstore.globalindexedblob "+
         "FROM odm_publicobject"+
         ", odm_document"+
         ", odm_contentobject"+
         ", odmm_contentstore"+
         ", odm_format "+
         "WHERE odm_publicobject.id = odm_document.id "+
         "AND odm_document.contentobject = odm_contentobject.id "+
         "AND odm_contentobject.content = odmm_contentstore.id "+
         "AND odm_contentobject.format = odm_format.id "+
         "AND odm_publicobject.name = ";
              theQuery += "'" + request.getParameter("fic") + "'";
              try {
                   System.out.println("TestIFS debut");
                   DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
                   Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@LXP9","ifssys","ifssys");
                   Statement stmt = conn.createStatement ();
                   ResultSet rset = stmt.executeQuery (theQuery);
                   while (rset.next ()) {
                        byte b[] = new byte[10000000];               
                        b = rset.getBlob(4).getBytes (1,10000000);
                        outbin.write (b);
                   rset.close();
                   System.out.println("TestIFS fin");
              catch (Exception e) {
    (beware mime type is forced to PDF, and file size max 10Mb)

  • How to poll a PL/SQL procedure in BPEL?

    Hi,
    Normally in BPEL your start your process flows by receiving an event. You can only create a BPEL instance via a Receive or Pick activity. I have a couple of integrations where I have to continually call a PL/SQL procedure and then call another PL/SQL procedure with the output from the first procedure. This is done by invoking 2 partner links and a While activity. I got this working fine. The problem is how to create the instance. At the moment I start the flow by reading in a dummy file with a Receive event. This works for now but if the process has to be restarted it will not work since BPEL know that it has already read the file.
    I have tried to start the flow with a receive activity that calls a PL/SQL procedure but I get the error “Operation is not specified” (http://theheat.dk/bpelDb1.jpg). Normally you would use a Invoke activity when calling a PL/SQL procedure, but when I try that I get an error because I don’t have a receive activity first (http://theheat.dk/bpelDb2.jpg)
    So basically I need a way to have a receive activity call a PL/SQL procedure.
    I have the exact same problem when I need to continually call a Web Service and send the output to a PL/SQL procedure. Here I need an Invoke activity that calls the Web Service and an Invoke that calls the PL/SQL procedure but to get the flow initiated BPEL wants a receive activity.
    Regards Pete

    I found a simple solution that works but I would like to hear if anybody can see any problems with this approach:
    I create a dummy table with one row. I create a partner link that polls the dummy table every 5 minutes. The operation on the table is an update, but the Read value and Unread value are the same!
    Every 5 minutes BPEL kicks of a process that calls a PL/SQL procedure etc. There will always be a row in the dummy table and as long as my polling interval is longer than the processing time of the flow I will never have more than one process in-flight at a time. This should ensure that the solution is robust.
    Regards Pete
    Message was edited by:
    Peter Lorenzen
    Message was edited by:
    Peter Lorenzen

  • IN operator is not working correctly while calling,although pl/sql procedur

    CREATE or REPLACE PROCEDURE TEST(
    idListCommaSeparated IN VARCHAR2
    AS
    CURSOR c_emp IS SELECT first_name,last_name,start_date From Employee where id IN(idListCommaSeparated);
    r_emp c_emp%ROWTYPE;
    begin
    insert into temp1 values('B',sysdate,sysdate,'A');
          open c_emp;
          loop
              fetch c_emp into r_emp;
              exit when c_emp%NOTFOUND;
              insert into temp1 values(r_emp.first_name,sysdate,sysdate,'A');
                 --business Logic
      end loop;
          close c_emp;
    end;
    /idListCommaSeparated contains values like (2,3,4). while executing this procedure on sqlplus it is succefully created.
    When i run the query separately on sqlplus
    SELECT first_name,last_name,start_date From Employee where id IN(2,3,4)I got some rows in result.
    why i am not getting via procedure correct result.
    and one more thing the number of elements in 'idListCommaSeparated' values are not fixed,sometimes it may be(2,3,4) or sometimes variable value may (2,3,5,6).
    I am not able to understand,where i am going wrong?

    see whether you find nested table parameter implantation option useful. Also supported by .net/java in case that's your calling appln.
    Below is plsql block having a procedure with input paramater of empid's. It returns a cursor( empno and ename) as out parameter.
    The empid's are hardcoded in the calling block.
    SQL> create type t_id is table of number
      2  /
    Type created.
    SQL> set serveroutput on
    SQL> declare
      2
      3   v_tid t_id;
      4   v_results sys_refcursor;
      5
      6   v_employee_id number;
      7   v_name varchar2(100);
      8
      9   procedure TEST (p_tid in t_id, p_empcursor out sys_refcursor)  as
    10   begin
    11    open p_empcursor for
    12    select empno, ename from scott.emp
    13    where empno in (select column_value from table (p_tid));
    14
    15   end;
    16
    17
    18  begin
    19   v_tid := t_id(7902,7934);
    20
    21   TEST(v_tid,v_results);
    22
    23   IF v_results IS NOT NULL
    24     THEN
    25        LOOP
    26           FETCH v_results
    27            INTO v_employee_id, v_name;
    28
    29           EXIT WHEN (v_results%NOTFOUND);
    30           dbms_output.put_line(v_name);
    31        END LOOP;
    32
    33        IF v_results%ISOPEN
    34        THEN
    35           CLOSE v_results;
    36        END IF;
    37    END IF;
    38
    39  end;
    40  /
    *FORD*
    *MILLER*
    PL/SQL procedure successfully completed.
    SQL>

  • Executing pl/sql procedure in SQL Workshop

    Hello.
    My understanding is that the only way to execute a pl/sql procedure in the SQL Workshop is via SQL Scripts, because running it under SQL Commands causes
    "ORA-00900: invalid SQL statement".
    Here is the statement I would like to run:
    execute efax_letter_to_pharmacist ('8888888888','ASDFSFSFSF','1','APN123456789','81');
    and here is the message I get when I run it under SQL Scripts:
    You have requested to run a script that does not contain any runnable statements.
    Script Name TEST
    Created on 02/14/2008 10:47:15 AM by ADMIN
    Updated on 02/14/2008 10:56:45 AM by ADMIN
    Number of Statements 0
    Script Size in Bytes 86
    thanks
    Boris

    Boris,
    Execute is a SQL*Plus command.
    It should work if you call your procedure in a begin-end block. e.g:
    begin
      efax_letter_to_pharmacist ('8888888888','ASDFSFSFSF','1','APN123456789','81');
    end;

  • How do I delete an LDAP entry and all of its child entries via PL/SQL

    I need to be able to delete (via PL/SQL) an entry and all of its child entries on my OID LDAP Server. None of the the procedures in the provided DBMS_LDAP package seem to bable to do this. For example, the delete_s procedure can only delete entries that are leaf nodes (no children). This will not work for me.
    I realize that I can execute the bulk delete shell script to do this, but this is via the command line, not PL/SQL.
    While I think I could write some PL/SQL code to parse through each entry using the "search_s" procedure and delete them one by one using the "delete_s" procedure, this doesn't seem very efficient. It seems like this should be a fairly common request and Oracle should have already addressed it.

    Sorry, to be clear, it's form fields on a web page that bring up all previously entered information.... I want to deleted some of these individually, but not all

  • Inserting to a clob field using cx_Oracle via a stored procedure

    Hello,
    Does anyone have experience using cx_Oracle to call a stored procedure which inserts to a clob field? I have found examples of doing this via straight SQL but I was hoping it was possible to do this via a stored procedure call. Thanks for any help you can provide.
    Jason

    And cursor.callproc('insert_clob_proc', (clob,))
    doesn't work for you?
    PrzemekYes - I should have been more clear in my original post. The callproc function works until we have a value which is over 32K. At values over 32K, we get an error message "ORA-01460: unimplemented or unreasonable conversion requested". I believe this is because we are sending the value as a string and so we would need to figure out how to send as a CLOB in cx_Oracle? Here is some code to use to test if interested...
    Oracle (Oracle Database 10g Release 10.1.0.4.0 - Production):
    CREATE TABLE clob_test (CLOB_FIELD CLOB);
    CREATE OR REPLACE PROCEDURE ins_clob_test (v_clob_field IN CLOB)
    AS
    BEGIN
    INSERT INTO clob_test (clob_field) VALUES (v_clob_field);
    END ins_clob_test;
    Python (2.5):
    conn = cx_Oracle.connect(xhash['oraclelogin'])
    cursor = conn.cursor()
    clob_var = 'Some test data' * 10000
    cursor.callproc('ins_clob_test',(clob_var,))
    conn.commit()
    cursor.close()
    conn.close()
    I should also mention that I am the Oracle developer and not the Python programmer - my knowledge of Python is very limited. I would like the Python programmers to use the procedures (packages) I have created to do their inserts but this situation has caused them to put the SQL directly in their code.
    Thanks again for any assistance you can provide.
    Jason

  • Attempting to create a AQ$_JMS_MAP_MESSAGE via PL/SQL

    I'm attempting to create a AQ$_JMS_MAP_MESSAGE via PL/SQL but can't get it to work.
    I'm able to create a AQ$_JMS_MESSAGE and add it to an AQ (of the correct type) however the AQ$_JMS_MAP_MESSAGE can not be constructed in the same way as it does not have a CONSTRUCT method.
    Is it possible to create this type of JMS message with PL/SQL? The documentation seems to imply that it can be done.
    I have tried the following but get an error; the AQ table is of type SYS.AQ$_JMS_MAP_MESSAGE.
    =====================================================
    procedure addMessageToAQ AS
    --message   SYS.AQ$_JMS_MAP_MESSAGE;
    message SYS.AQ$_JMS_MESSAGE;
    eopt dbms_aq.enqueue_options_t;
    mprop dbms_aq.message_properties_t;
    enq_msgid raw(16);
    BEGIN
    message := SYS.AQ$_JMS_MESSAGE.CONSTRUCT(DBMS_AQ.JMS_MAP_MESSAGE);
    IF ( message.message_type = DBMS_AQ.JMS_MAP_MESSAGE) THEN
    DBMS_OUTPUT.PUT_LINE('The message is a map message');
    END IF;
    message.message_type := DBMS_AQ.JMS_MAP_MESSAGE;
    message.header.set_string_property('header1','hvalue1');
    message.header.set_string_property('header2','hvalue2');
    message.header.set_string_property('header3','hvalue3');
    message.set_string_property('content1', 'cvalue1');
    message.set_string_property('content2', 'cvalue2');
    message.set_string_property('content3', 'cvalue3');
    DBMS_AQ.enqueue(queue_name => 'PROCESS_PASSP_APL_Q',
    enqueue_options => eopt,
    message_properties => mprop,
    payload => message,
    msgid => enq_msgid);
    END;
    =====================================================
    ORA-25215: user_data type and queue type do not match
    ORA-06512: at "SYS.DBMS_AQ", line 204
    ORA-06512: at "BDEV1.PS2032_MVMNTHNDSHKEXTRCT", line 48
    ORA-06512: at "BDEV1.JDEV_TMP_PROC_1", line 3
    The message is a map message
    Process exited.

    As far as I know every object type in database has an implicit construct . It's just that nobody created some nice constructor. Take this example as a "hard way" to create message:
    -- jms_text_message related variables
    tmp_text_message SYS.AQ$_JMS_TEXT_MESSAGE;
    tmp_header SYS.AQ$_JMS_HEADER;
    tmp_array SYS.AQ$_JMS_USERPROPARRAY;
    -- AQ related variables
    enq_msgid RAW(16);
    eopt dbms_aq.enqueue_options_t;
    mprop dbms_aq.message_properties_t;
    -- get current date time, so it doesn't change during run of procedure
    current_datetime := TO_CHAR(SYSDATE,'DDMMYYYYHHMISS');
    -- initialize array
    tmp_array := SYS.AQ$_JMS_USERPROPARRAY(SYS.AQ$_JMS_USERPROPERTY('EVENT_TYPE', 100, 'PL_SQL', NULL, 27));
    -- create header
    tmp_header := SYS.AQ$_JMS_HEADER(SYS.AQ$_AGENT(NULL, NULL, 0), NULL, NULL, NULL, NULL, 0, tmp_array);
    -- create JMS_TEXT_MESSAGE
    tmp_text_message := SYS.AQ$_JMS_TEXT_MESSAGE(tmp_header,4,'AAAA',NULL);
    dbms_aq.enqueue(
    queue_name => 'job_queue',
    enqueue_options => eopt,
    message_properties => mprop,
    payload => tmp_text_message,
    msgid => enq_msgid);
    ...

  • 403 Forbidden error calling PL/SQL Procedure from URL

    I am getting a 403 Forbidden browser error when calling a PL/SQL procedure from the URL, as in this:
    http://<server.port>/apex/SCHEMA.procedure_name/f?p_param1=394&p_param2=2, etc
    We are upgrading from HTMLDB 2.0 to APEX 4.0.2. I do not believe the upgrade has anything to do with it, c/o the upgraded app works fine in another APE 4.0.2 environment.
    The upgrade is to new machines, new DB and new app server, Oracle Web Tier, Oracle HTTP server deployment.
    The dads.conf entries are fine, all standard:
    Alias /i/ "/apexd01/app/oracle/product/http/Oracle_WT1/ohs/images/"
    Alias /c/ "/apexd01/app/oracle/product/http/Oracle_WT1/ohs/custom_htmldb/"
    <Location /pls/apexd>
    Order deny,allow
    PlsqlDocumentPath docs
    AllowOverride None
    PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
    PlsqlDatabaseConnectString dbserver.us.com:1521:SERVER.US.COM ServiceNameFormat
    PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
    PlsqlAuthenticationMode Basic
    SetHandler pls_handler
    PlsqlDocumentTablename wwv_flow_file_objects$
    PlsqlDatabaseUsername APEX_PUBLIC_USER
    PlsqlDefaultPage apex
    PlsqlDatabasePassword apexpwd
    PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
    Allow from all
    </Location>
    The GRANT EXECUTE ON procedure TO PUBLIC is there.
    A call to the same procedure via a process in an APEX page works fine - the procedure is OK.
    The call from javascript, which sets up the call from the URL, is the one that fails with the 403 Forbidden error.
    The same app works fine in another APEX 4.0.2 environment, so I know it is not the JS; It has to be some configuration setting in this environment.
    I do NOT have access to the app server.
    I have asked that they compare the httpd.conf, and all underlying conf files, to check for differences.
    In order for me to be more specific, and hopefully speed up the troubleshooting process, can anyone suggest what other settings to look at?
    Thank you - Karen

    Hello,
    Good catch, but the difference in URL is in fact the difference in my env to theirs. My typo in not correcting my example to match the dads.conf entry of /pls/apexd. My env uses /apex/. Just saves on my typing.
    As an update, I asked the DBA to double-check, and yes, the www_flow_epg_include_mod_local function IS there.
    www_flow_epg_include_mod_local is an APEX function.
    So now we are trying adding procedures to it. I'll let you know if it works.
    My previous question remains - why would I need to do this in one env, and not another,
    given that the DB GRANTs are there.
    Is there a particular app server setting that wil block execution of PL/SL procedures from the URL?
    My guess is, there is some difference in configuration settings for the app server, somewhere in the httpd.conf chain.
    Since I do not have access to those files, I cannot do a diff myself, as I would have if I the issue was on my machine.
    I am in a situation where I can suggest what to do, but that's it. I agree, it's hard to troubleshoot in this situation.
    I am being asked "what setting do I need to change?" without the benefit of access to what is there,so I am doing the best I can, without diverting from my work for a deep-dive refresher session on httpd.conf settings.
    So, if anyone is aware of some setting that would block execution of a PL/SQL proc from the URL, please let me know,
    and of course, if adding a proc to www_flow_epg_include_mod_local works, I'll be happy. Just still curious.
    Thank you - K

Maybe you are looking for

  • What is Cell  Definition  (BW 3.5)

    Hi Experts, Could any of you explain what is the Cell definition and how that is useful in reporting (SAP BW 3.5) Please explain with a good example as Iam struggling to understand teh exact use of this. Points guaranteed. Thanks & Regards, Sunny

  • ALSB 2.6 download

    Do any one know from where i can download the ALSB 2.6 trial version?

  • Why does my ipad 2 randomly click on everything?

    I got an ipad 2 for christmas and it worked properly for about a week, after that week it started clicking randomly on apps without me being anywhere near it, it randomly clicks on letters when i am trying to type, it returns back to the homepage whe

  • H.264 .mov problem how can you fix thumbnail and sound issue in Imovie08

    Hi Experts, So I used Dvdxdv to rip my personal DVD's to my mac. Since the files were 1.69gb each for a small amount of video, I used quicktime to compress them to H.264 the codecs is Integer(little Endian),H.264 to be exact. An 8 minute video is now

  • I've lost my data control palette

    well this is embarrassing my JDeveloper 11.1.2.2 seemed to switch roles from "all features" to "java developer" (maybe I did it, but I don't remember doing it) so I switched it back to "all features" and everything seems ok except I can't see my data