Optimization Help ?? Pl/sql procedure

Hi people,
I have 2 procedure and they are taking forever to complete.
I need your help in optimizing those procedures to finish my task.
My task is data migration. I am using Oracle 11g , DQL Dev 3.0
I have to migrate about 2 million records.
I would like to know why my procedure is taking a long time when it comes to insertion.
My current code inserts about 300 records every 10 minutes.
Could it be my Cases statements ??
if it is, what would be a better solution ??
Note: The code is working, however its slow. I need it to be faster.
Thanks in advance for your help.
here are some data just to understand what is the code doing:
Please look at DOC_TYPE_CODE in procedure, maybe thats where the problem is (case statement)
20100121085123687(SOR_DOC)-00010641.PDF
20100121103547355(PSR_DOC)-058744_148631696.pdf
20100121115927953(JC_DOC)-00013741.PDF
20100122102257379(REV_DOC)-6-034848_141278871.pdf
20100128105556824(OTHER_DOC)-2-059399_590886456.pdf
20100203113810388(PLEA_DOC)-059019_44397339.pdfhere are the 2 procedures
create or replace
PROCEDURE RUN
AS
BEGIN
     FOR I IN (SELECT DCOLLECTIONID FROM COLMETA)
     LOOP
          DOCUMENT_INSERTION(TO_NUMBER(I.DCOLLECTIONID));
     END LOOP;
END;
create or replace
PROCEDURE DOCUMENT_INSERTION(XCOL_ID NUMBER) AS
COUNT_NUM NUMBER := 0;
BEGIN
     -- GET THE COUNT
     SELECT      COUNT(*)
     INTO      COUNT_NUM
     FROM      DOCMETA D,
               CASES_DOCUMENTS DOC,
               COLLECTIONS C
     WHERE     D.XCOLLECTIONID = XCOL_ID
     AND      DOC.DID = D.DID
     AND      C.DCOLLECTIONID = D.XCOLLECTIONID
     AND      D.XFOLDERNAME = C.DCOLLECTIONNAME
     AND      DOC.DISPRIMARY = 1;
     -- START THE INSERTION PROCESS
     INSERT INTO DOCUMENTS
     SELECT
          DM.DID AS DID,
          C.DCOLLECTIONID AS SUBMISSION_ID,
          CASE
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                     INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) = 'PSR' THEN 10
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                     INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) = 'JC' THEN 20
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                     INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) = 'SOR' THEN 30
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                     INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) = 'PLEA' THEN 40
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                     INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) = 'INDICT' THEN 50
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                     INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) = 'OTHER' THEN 80
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                     INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) = 'AMEND' THEN 80
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                     INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) = 'REV' THEN 80
               WHEN COUNT_NUM = 1 THEN 150   /* CODE FOR MAIN IS 150 */
               ELSE 160       /* CODE FOR UNKNOWN IS 160 */
          END AS DOC_TYPE_CODE,
          NULL AS BFILEDATA,
          CASE
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                   INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) = 'AMEND' THEN 'OTHER'
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                   INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) = 'REV' THEN 'OTHER'
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                   INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) IS NULL
                     AND COUNT_NUM = 1 THEN 'MAIN'
               WHEN SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                   INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1) IS NULL
                     AND COUNT_NUM > 1 THEN 'UNKNOWN'
               ELSE SUBSTR(D.DORIGINALNAME, INSTR(D.DORIGINALNAME,'(') + 1,
                   INSTR(D.DORIGINALNAME,'_DOC') - INSTR(D.DORIGINALNAME,'(') - 1)
          END AS DOC_NAME,
          D.DFORMAT AS MIME_TYPE
FROM      CASES_DOCUMENTS D,
          DOCMETA DM,
          COLMETA C
WHERE     DM.XCOLLECTIONID = XCOL_ID
AND      DM.XCOLLECTIONID = C.DCOLLECTIONID
AND      D.DID = DM.DID
AND      D.DISPRIMARY = 1;
COMMIT;     /* Committing the record */
END;

Thanks everyone for the help.
here is the DDL
CREATE TABLE "CASES_DOCUMENTS"
    "DDOCID"        NUMBER(38,0) NOT NULL ENABLE,
    "DID"           NUMBER(38,0),
    "DISPRIMARY"    NUMBER(1,0) NOT NULL ENABLE,
    "DORIGINALNAME" VARCHAR2(255 CHAR),
    "DFORMAT"       VARCHAR2(80 CHAR),
    "DFILESIZE"     NUMBER(38,0)
  CREATE TABLE "DOCMETA"
    "DID"                   NUMBER(38,0) NOT NULL ENABLE,
    "XCOLLECTIONID"         NUMBER(38,0),
    "XUSSCID"              VARCHAR2(30 CHAR),
    "XSUBMISSIONID"        VARCHAR2(30 CHAR),
    "XMISSINGCASE"         VARCHAR2(30 CHAR),
     "XFOLDERNAME"          VARCHAR2(200 CHAR),
    "XDEFTYPE"       VARCHAR2(30 CHAR),
    CONSTRAINT "PK_DOCMETA" PRIMARY KEY ("DID")
  CREATE TABLE "COLMETA"
    "DCOLLECTIONID"         NUMBER(38,0) NOT NULL ENABLE,
    "XUSSCID"              VARCHAR2(30 CHAR),
    CONSTRAINT "PK_COLLECTIONMETA" PRIMARY KEY ("DCOLLECTIONID")
  CREATE TABLE "COLLECTIONS"
    "DCOLLECTIONID"       NUMBER(38,0) NOT NULL ENABLE,
    "DCOLLECTIONGUID"     VARCHAR2(36 CHAR) NOT NULL ENABLE,
     "DPARENTCOLLECTIONID" NUMBER(38,0),
    CONSTRAINT "PK_COLLECTIONID" PRIMARY KEY ("DCOLLECTIONID")
    CONSTRAINT "UK_COLLECTIONNAMES" UNIQUE ("DCOLLECTIONNAME", "DPARENTCOLLECTIONID")
/* insert statements */
Insert into "cases_documents" (DDOCID,DID,DISPRIMARY,DORIGINALNAME,DFORMAT,DFILESIZE) values (271787,135894,1,'20100121085123687(SOR_DOC)-00010641.PDF','Application/pdf',202115);
Insert into "cases_documents" (DDOCID,DID,DISPRIMARY,DORIGINALNAME,DFORMAT,DFILESIZE) values (271823,135912,1,'20100121103547355(PSR_DOC)-058744_148631696.pdf','Application/pdf',1118423);
Insert into "cases_documents" (DDOCID,DID,DISPRIMARY,DORIGINALNAME,DFORMAT,DFILESIZE) values (271861,135931,1,'20100121110415669(SOR_DOC)-058011_58041316.pdf','Application/pdf',219272);
Insert into "cases_documents" (DDOCID,DID,DISPRIMARY,DORIGINALNAME,DFORMAT,DFILESIZE) values (271937,135969,1,'20100121115927953(JC_DOC)-00013741.PDF','Application/pdf',259548);
Insert into "cases_documents" (DDOCID,DID,DISPRIMARY,DORIGINALNAME,DFORMAT,DFILESIZE) values (272051,136026,1,'20100122102257379(REV_DOC)-6-034848_141278871.pdf','Application/pdf',230619);
Insert into "cases_documents" (DDOCID,DID,DISPRIMARY,DORIGINALNAME,DFORMAT,DFILESIZE) values (272087,136044,1,'20100125111357271(JC_DOC)-00011510.PDF','Application/pdf',102264);
Insert into "cases_documents" (DDOCID,DID,DISPRIMARY,DORIGINALNAME,DFORMAT,DFILESIZE) values (272159,136080,1,'20100126112526792(SOR_DOC)-1-00013020.PDF','Application/pdf',244530);
Insert into "cases_documents" (DDOCID,DID,DISPRIMARY,DORIGINALNAME,DFORMAT,DFILESIZE) values (272235,136118,1,'20100126182111728(PSR_DOC)-059335_498074466.pdf','Application/pdf',963139);
Insert into "cases_documents" (DDOCID,DID,DISPRIMARY,DORIGINALNAME,DFORMAT,DFILESIZE) values (272275,136138,1,'20100127115025011(REV_DOC)-1-00006915.PDF','Application/pdf',649596);
Insert into "docmeta" (DID,XCOLLECTIONID,XUSSCID,XSUBMISSIONID,XMISSINGCASE,XFOLDERNAME,XDEFTYPE) values (135894,798044066,'1303497','416738','false','124341_20100121085123687','10');
Insert into "docmeta" (DID,XCOLLECTIONID,XUSSCID,XSUBMISSIONID,XMISSINGCASE,XFOLDERNAME,XDEFTYPE) values (135912,798044069,'1302059','416812','false','124341_20100121103547355','10');
Insert into "docmeta" (DID,XCOLLECTIONID,XUSSCID,XSUBMISSIONID,XMISSINGCASE,XFOLDERNAME,XDEFTYPE) values (135931,798044072,'1300935','416834','false','124341_20100121110415669','10');
Insert into "docmeta" (DID,XCOLLECTIONID,XUSSCID,XSUBMISSIONID,XMISSINGCASE,XFOLDERNAME,XDEFTYPE) values (135969,798044079,'1301693','416897','false','124341_20100121115927953','10');
Insert into "docmeta" (DID,XCOLLECTIONID,XUSSCID,XSUBMISSIONID,XMISSINGCASE,XFOLDERNAME,XDEFTYPE) values (136026,798044088,null,'417263','false','124341_20100122102257379','12');
Insert into "docmeta" (DID,XCOLLECTIONID,XUSSCID,XSUBMISSIONID,XMISSINGCASE,XFOLDERNAME,XDEFTYPE) values (136044,798044092,'901763','417720','false','124341_20100125111357271','12');
Insert into "docmeta" (DID,XCOLLECTIONID,XUSSCID,XSUBMISSIONID,XMISSINGCASE,XFOLDERNAME,XDEFTYPE) values (136080,798044099,'1214058','418182','false','124341_20100126112526792','11');
Insert into "docmeta" (DID,XCOLLECTIONID,XUSSCID,XSUBMISSIONID,XMISSINGCASE,XFOLDERNAME,XDEFTYPE) values (136118,798044105,'1304859','418444','false','124341_20100126182111728','10');
Insert into "docmeta" (DID,XCOLLECTIONID,XUSSCID,XSUBMISSIONID,XMISSINGCASE,XFOLDERNAME,XDEFTYPE) values (1361380,798451924,'1273153','386886','false','124152_20090930102348552','10');
Insert into "colmeta" (DCOLLECTIONID,XUSSCID) values (798044066,'1303497');
Insert into "colmeta" (DCOLLECTIONID,XUSSCID) values (798044069,'1302059');
Insert into "colmeta" (DCOLLECTIONID,XUSSCID) values (798044072,'1300935');
Insert into "colmeta" (DCOLLECTIONID,XUSSCID) values (798044079,'1301693');
Insert into "colmeta" (DCOLLECTIONID,XUSSCID) values (798044088,null);
Insert into "colmeta" (DCOLLECTIONID,XUSSCID) values (798044092,'901763');
Insert into "colmeta" (DCOLLECTIONID,XUSSCID) values (798044099,'1214058');
Insert into "colmeta" (DCOLLECTIONID,XUSSCID) values (798044105,'1304859');
Insert into "colmeta" (DCOLLECTIONID,XUSSCID) values (798451924,'1273153');
Insert into "collections" (DCOLLECTIONID,DCOLLECTIONGUID,DPARENTCOLLECTIONID) values (798044066,'89532951-9E1A-1EAF-D74C-F317AD2A4880',798044005);
Insert into "collections" (DCOLLECTIONID,DCOLLECTIONGUID,DPARENTCOLLECTIONID) values (798044069,'0533F5D5-5C70-6661-EF54-74F2B78F342C',798044005);
Insert into "collections" (DCOLLECTIONID,DCOLLECTIONGUID,DPARENTCOLLECTIONID) values (798044072,'58A26BB4-3BE9-28C8-8A83-1DAD6FDBAD4D',798044005);
Insert into "collections" (DCOLLECTIONID,DCOLLECTIONGUID,DPARENTCOLLECTIONID) values (798044079,'61471A50-1711-DA1B-90C9-9BE7EE4A1A1A',798044005);
Insert into "collections" (DCOLLECTIONID,DCOLLECTIONGUID,DPARENTCOLLECTIONID) values (798044088,'412F77D8-9784-AE91-7B28-F469B852C70D',798044005);
Insert into "collections" (DCOLLECTIONID,DCOLLECTIONGUID,DPARENTCOLLECTIONID) values (798044092,'E161DDD6-A297-A514-2BCA-C4E43415C3A6',798044005);
Insert into "collections" (DCOLLECTIONID,DCOLLECTIONGUID,DPARENTCOLLECTIONID) values (798044099,'6CB6366A-83B1-ADD3-2F86-75C13401C866',798044005);
Insert into "collections" (DCOLLECTIONID,DCOLLECTIONGUID,DPARENTCOLLECTIONID) values (798044105,'46556A82-E55A-DD4E-7D21-D39C9DC365AB',798044005);
Insert into "collections" (DCOLLECTIONID,DCOLLECTIONGUID,DPARENTCOLLECTIONID) values (798451924,'C959D755-E792-6C32-A804-0F9DE9FDAC21',798451840);
Note: xcollectionid in docmeta = dcollectionid in colmeta

Similar Messages

  • Need help in writing a tricky sql/PL/Sql Procedure

    Hi,
    I have a Branch table with just two fields in it node1 and Node2, The table looks like this
    node1 | node2
    -------|---------
    1 | 2
    3 | 2
    3 | 4
    4 | 5
    1 | 5
    1 | 6
    5 | 6
    in the above data if you draw lines between node_1 and node_2 you will see that there are 3 different paths to get from 1 to 5, as follows
    /--------6-------\
    1----------------------5
    \2------3-------4/
    Now I need to Find all the nodes between 1 and 5 or all the possible paths from node 1 to node 5 in this case I have 3 possible paths they are as follows
    1-2-3-4-5
    1-3-5
    1-5
    Now I know if this data was stored in a hierarchical manner I can get the results i want by using CONNECT BY and SYS_CONNECT_BY_PATH.
    Is there a way to transform this data into a hierarchcal manner so that I can use the CONNECT BY or can somebody give me an Idea as to how to write a PL/SQL procedure to get the result I want.
    Any help will be greatly appreciated

    Hi!
    1.Create another table Branch1 to hold 'transformed data'.
    2.Use the following procedure to insert data into branch1 table.
    declare
    cursor n is select * from branch;
    begin
    for nrec in n loop
    if nrec.node1 = 5 then
         insert into branch1(node1,node2) values(nrec.node2,nrec.node1);
    elsif nrec.node2= 5 then
         insert into branch1(node1,node2) values(nrec.node1,nrec.node2);
    else
    if      nrec.node2> 5      then
         insert into branch1(node1,node2) values(nrec.node1,nrec.node2);
    elsif nrec.node1> 5 then
         insert into branch1(node1,node2) values(nrec.node2,nrec.node1);
    elsif (nrec.node1 < nrec.node2 ) then
         insert into branch1(node1,node2) values(nrec.node1,nrec.node2);
    else
         insert into branch1(node1,node2) values(nrec.node2,nrec.node1);
    end if;
    end if;
    end loop;
    commit;
    end;
    3.Then execute the following connect by query:
    SQL> select lpad(' ',level*2,' ')||node1 from branch1
    2 start with node1=1
    3 connect by prior node2=node1;
    Hope this is satisfactory.
    Thanks!

  • ORA-01458 error while using Pro*C to invoke PL/SQL procedure, pls help

    I am using Pro*C (Oracle 10g on Itanium platform) to invoke PL/SQL procedure to read RAW data from database, but always encoutered ORA-01458 error message.
    Here is the snippet of Pro*C code:
    typedef struct dataSegment
         unsigned short     len;
         unsigned char     data[SIZE_DATA_SEG];
    } msg_data_seg;
    EXEC SQL TYPE msg_data_seg IS VARRAW(SIZE_DATA_SEG);
         EXEC SQL BEGIN DECLARE SECTION;
              unsigned short qID;
              int rMode;
              unsigned long rawMsgID;
              unsigned long msgID;
              unsigned short msgType;
              unsigned short msgPriority;
              char recvTime[SIZE_TIME_STRING];
              char schedTime[SIZE_TIME_STRING];
              msg_data_seg dataSeg;
              msg_data_seg dataSeg1;
              msg_data_seg dataSeg2;
              short     indSeg;
              short     indSeg1;
              short     indSeg2;
         EXEC SQL END DECLARE SECTION;
         qID = q_id;
         rMode = (int)mode;
         EXEC SQL EXECUTE
              BEGIN
                   SUMsg.read_msg (:qID, :rMode, :rawMsgID, :msgID, :msgType, :msgPriority, :recvTime,
                        :schedTime, :dataSeg:indSeg, :dataSeg1:indSeg1, :dataSeg2:indSeg2);
              END;
         END-EXEC;
         // Check PL/SQL execute result, different from SQL
         // Only 'sqlcode' and 'sqlerrm' are always set
         if (sqlca.sqlcode != 0)
              if (sqlca.sqlcode == ERR_QUEUE_EMPTY)          // Queue empty
                   throw q_eoq ();
              char msg[513];                                        // Other errors
              size_t msg_len;
              msg_len = sqlca.sqlerrm.sqlerrml;
              strncpy (msg, sqlca.sqlerrm.sqlerrmc, msg_len);
              msg[msg_len] = '\0';
              throw db_error (string(msg), sqlca.sqlcode);
    and here is the PL/SQL which is invoked:
    SUBTYPE VarChar14 IS VARCHAR2(14);
    PROCEDURE read_msg (
         qID          IN     sumsg_queue_def.q_id%TYPE,
         rMode          IN     INTEGER,
         raw_msgID     OUT     sumsg_msg_data.raw_msg_id%TYPE,
         msgID          OUT sumsg_msg_data.msg_id%TYPE,
         msgType          OUT sumsg_msg_data.type%TYPE,
         msgPrior     OUT sumsg_msg_data.priority%TYPE,
         msgRecv          OUT VarChar14,
         msgSched     OUT VarChar14,
         msgData          OUT sumsg_msg_data.msg_data%TYPE,
         msgData1     OUT sumsg_msg_data.msg_data1%TYPE,
         msgData2     OUT sumsg_msg_data.msg_data2%TYPE
    ) IS
    BEGIN
         IF rMode = 0 THEN
              SELECT raw_msg_id, msg_id, type, priority, TO_CHAR(recv_time, 'YYYYMMDDHH24MISS'),
                   TO_CHAR(sched_time, 'YYYYMMDDHH24MISS'), msg_data, msg_data1, msg_data2
                   INTO raw_msgID, msgID, msgType, msgPrior, msgRecv, msgSched, msgData, msgData1, msgData2
                   FROM (SELECT * FROM sumsg_msg_data WHERE q_id = qID AND status = 0 ORDER BY sched_time, raw_msg_id)
                   WHERE ROWNUM = 1;
         ELSIF rMode = 1 THEN
              SELECT raw_msg_id, msg_id, type, priority, TO_CHAR(recv_time, 'YYYYMMDDHH24MISS'),
                   TO_CHAR(sched_time, 'YYYYMMDDHH24MISS'), msg_data, msg_data1, msg_data2
                   INTO raw_msgID, msgID, msgType, msgPrior, msgRecv, msgSched, msgData, msgData1, msgData2
                   FROM (SELECT * FROM sumsg_msg_data WHERE q_id = qID AND status = 0 ORDER BY recv_time, raw_msg_id)
                   WHERE ROWNUM = 1;
         ELSE
              SELECT raw_msg_id, msg_id, type, priority, TO_CHAR(recv_time, 'YYYYMMDDHH24MISS'),
                   TO_CHAR(sched_time, 'YYYYMMDDHH24MISS'), msg_data, msg_data1, msg_data2
                   INTO raw_msgID, msgID, msgType, msgPrior, msgRecv, msgSched, msgData, msgData1, msgData2
                   FROM (SELECT * FROM sumsg_msg_data WHERE q_id = qID AND status = 0 ORDER BY priority, raw_msg_id)
                   WHERE ROWNUM = 1;
         END IF;
         UPDATE sumsg_msg_data SET status = 1 WHERE raw_msg_id = raw_msgID;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
              raise_application_error (-20102, 'Queue empty');
    END read_msg;
    where sumsg_msg_data.msg_data%TYPE, sumsg_msg_data.msg_data1%TYPE and sumsg_msg_data.msg_data2%TYPE are all defined as RAW(2000). When I test the PL/SQL code seperately, everything is ok, but if I use the Pro*C code to read, the ORA-01458 always happen, unless I change the SIZE_DATA_SEG value to 4000, then it passes, and the result read out also seems ok, either the bigger or smaller value will encounter ORA-01458.
    I think the problem should happen between the mapping from internal datatype to external VARRAW type, but cannot understand why 4000 bytes buffer will be ok, is it related to some NLS_LANG settings, anyone can help me to resolve this problme, thanks a lot!

    It seems that I found the way to avoid this error. Now each time before I read RAW(2000) data from database, i initialize the VARRAW.len first, set its value to SIZE_DATA_SEG, i.e., the outside buffer size, then the error disappear.
    Oracle seems to need this information to handle its data mapping, but why output variable also needs this initialization, cannot precompiler get this from the definition of VARRAW structure?
    Anyone have some suggestion?

  • Optimizing Pl/SQL procedure for fast execution

    Hi All,
    What are the tips that we must take care while writing pl/sql procedure or function, that it execute smoothly without any strains or resources.
    And if any of the procedure or function is not running fast enough is there any DBMS package or something like EXPLAIN PLAN to see the execution path used by optimizer or to analyze the code in that procedure or function to establish what causing the problem ?
    Any help will be highly appriciated.
    Thanking you and best regards.

    And if any of the procedure or function is not running fast enough is there any DBMS package or something like EXPLAIN PLAN to see the execution path used by optimizer or to analyze the code in that procedure or function to establish what causing the problem ?
    Yes it is. :)
    Read this:
    http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b10752/toc.htm
    Peter D.

  • Unable to capture the parameter values from a PL/SQL procedure

    hi.
    i'm trying to capture the parameter values of a PL/SQL procedure by calling inside a anonymous block but i'm getting a "reference to uninitialized collection error" ORA-06531.
    Please help me regarding.
    i'm using following block for calling the procedure.
    declare
    err_cd varchar2(1000);
    err_txt VARCHAR2(5000);
    no_of_recs number;
    out_sign_tab search_sign_tab_type:=search_sign_tab_type(search_sign_type(NULL,NULL,NULL,NULL,NULL));
    cntr_var number:=0;
    begin
         rt843pq('DWS','3000552485',out_sign_tab,no_of_recs,err_cd,err_txt);
         dbms_output.put_line('The error is ' ||err_cd);
         dbms_output.put_line('The error is ' ||err_txt);
         dbms_output.put_line('The cntr is ' ||cntr_var);
         for incr in 1 .. OUT_SIGN_TAB.count
         loop
         cntr_var := cntr_var + 1 ;
    Dbms_output.put_line(OUT_SIGN_TAB(incr).ref_no||','||OUT_SIGN_TAB(incr).ciref_no||','||OUT_SIGN_TAB(incr).ac_no||','||OUT_SIGN_TAB(incr).txn_type||','||OUT_SIGN_TAB(incr).objid);
    end loop;
    end;
    Error is thrown on "for incr in 1 .. OUT_SIGN_TAB.count" this line
    Following is some related information.
    the 3rd parameter of the procedure is a out parameter. it is a type of a PL/SQL table (SEARCH_SIGN_TAB_TYPE) which is available in database as follows.
    TYPE "SEARCH_SIGN_TAB_TYPE" IS TABLE OF SEARCH_SIGN_TYPE
    TYPE "SEARCH_SIGN_TYPE" AS OBJECT
    (ref_no VARCHAR2(22),
    ciref_no VARCHAR2(352),
    ac_no VARCHAR2(22),
    txn_type VARCHAR2(301),
    objid VARCHAR2(1024))............

    We don't have your rt843pq procedure, but when commenting that line out, everything works:
    SQL> create TYPE "SEARCH_SIGN_TYPE" AS OBJECT
      2  (ref_no VARCHAR2(22),
      3  ciref_no VARCHAR2(352),
      4  ac_no VARCHAR2(22),
      5  txn_type VARCHAR2(301),
      6  objid VARCHAR2(1024))
      7  /
    Type is aangemaakt.
    SQL> create type "SEARCH_SIGN_TAB_TYPE" IS TABLE OF SEARCH_SIGN_TYPE
      2  /
    Type is aangemaakt.
    SQL> declare
      2    err_cd varchar2(1000);
      3    err_txt VARCHAR2(5000);
      4    no_of_recs number;
      5    out_sign_tab search_sign_tab_type:=search_sign_tab_type(search_sign_type(NULL,NULL,NULL,NULL,NULL));
      6    cntr_var number:=0;
      7  begin
      8    -- rt843pq('DWS','3000552485',out_sign_tab,no_of_recs,err_cd,err_txt);
      9    dbms_output.put_line('The error is ' ||err_cd);
    10    dbms_output.put_line('The error is ' ||err_txt);
    11    dbms_output.put_line('The cntr is ' ||cntr_var);
    12    for incr in 1 .. OUT_SIGN_TAB.count
    13    loop
    14      cntr_var := cntr_var + 1 ;
    15      Dbms_output.put_line(OUT_SIGN_TAB(incr).ref_no||','||OUT_SIGN_TAB(incr).ciref_no||','||OUT_SIGN_TAB(incr).ac_no||','||OUT_SIGN
    TAB(incr).txntype||','||OUT_SIGN_TAB(incr).objid);
    16    end loop;
    17  end;
    18  /
    The error is
    The error is
    The cntr is 0
    PL/SQL-procedure is geslaagd.Regards,
    Rob.

  • How to call a PL/SQL procedure from Portal

    Env.Info: Windows NT Server 4 (Service Pack 3) / Oracle 8i R3 EE / Oracle Portal 3.0 Production.
    I created a new schema "BISAPPS" and created a user with the same name. Ran provsyns.sql script to grant Portal API access. Created a new package under this new schema and compiled it against the database. After that I registered the schema as a portal provider. There were no errors.
    Now I logged into Portal using the account PORTAL30. Refreshed the portlet repository and the new portlets appeared. I added the new portlet to the page. It is displayed successfully.
    New portlet allows the user to enter a bug-number and lets the user to either view or edit. If the user clicks on the button "Edit", it opens a new window and displays the contents from BugDB application. But if the user clicks on "Show", it should display the output generated by a PL/SQL procedure (Owned by the above New Schema - BISAPPS) in a separate window. But instead it is displaying the following error in the separate window:
    bisapps_pkg.buginfo: PROCEDURE DOESN'T EXIST.
    DAD name: PORTAL30
    PROCEDURE : bisapps_pkg.buginfo
    URL : http://host_name:80/pls/portal30/bisapps_pkg.buginfo
    And list of environment variables ....
    Can anyone help me? How can I call a PL/SQL procedure when the button is clicked? Thanks in advance.

    You must grant EXECUTE privilege on your procedure to the PORTAL30_PUBLIC user. If the error still persists, create a PUBLIC synonym for your procedure.

  • How to get data from URL in a PL/SQL procedure

    Hi!<br>
    <br>
    I want to pass values in APEX from a report with a link to a PL/SQL procedure through URL.
    How can I make this?<br>
    <br>
    For example:<br>
    <br>
    I have a report:<br>
    <br>
    select<br>
       id,<br>
       name,<br>
       akt,<br>
       case<br>
          when akt is NULL then '< a href="f?p=&APP_ID.:27:&SESSION.:START_PROCESS" name="test_link" >set< /a >'<br>
       end choice<br>
    from<br>
       USERS;<br>
    <br>
    I want to pass the value "id" in the link ( named "test_link" ) . And want to use this value in a process like this:<br>
    <br>
    DECLARE<br>
       v_user_id NUMBER(10);<br>
    BEGIN<br>
       --I want to read this value from the url<br>
       if :REQUEST='START_PROCESS' then<br>
          v_user_id := ????;<br>
          <br>
          ...<br>
       end if;<br>
    END;<br>
    <br>
    <br>
    Thanks!<br>
    Marton

    Hi,
    1- Create a hidden item P27_USER_ID on page 27
    2- Change your code :
    SELECT ID, NAME, akt,
           CASE
              WHEN akt IS NULL
                 THEN    '< a href="f?p=&APP_ID.:27:&SESSION.:START_PROCESS:NO::P27_USER_ID:'
                      || ID
                      || '" name="test_link" >set< /a >'
           -- refer to f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
           END choice
      FROM users;
       And then
    DECLARE
       v_user_id   NUMBER (10);
    BEGIN
       --I want to read this value from the url
       IF :request = 'START_PROCESS'
       THEN
          v_user_id := :p27_user_id;
           --your code
       END IF;
    END;Hope this helps,
    Grégory

  • Error when try to call a pl/sql procedure from the .xsql file

    I tried to call a pl/sql procedure like this:
    <?xml version="1.0"?>
    <page connection="omtest5" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-owa>
    sampleowaxml.testone
    </xsql:include-owa>
    </page>
    but I got the following error message:
    <?xml version="1.0" ?>
    - <page>
    - <xsql-error action="xsql:include-owa">
    <statement>declare buf htp.htbuf_arr; param_names owa.vc_arr; param_values owa.vc_arr; rows integer := 32767; outclob CLOB;begin param_names(1) := 'HTTP_COOKIE'; param_values(1) := ''; param_names(2) := 'SERVER_NAME'; param_values(2) := 'mxfang-nt.us.oracle.com'; param_names(3) := 'SERVER_PORT'; param_values(3) := '80'; param_names(4) := 'SCRIPT_NAME'; param_values(4) := '/servlets/oracle.xml.xsql.XSQLServlet'; param_names(5) := 'PATH_INFO'; param_values(5) := '/xsql/test/myproject.xsql'; param_names(6) := 'HTTP_USER_AGENT'; param_values(6) := 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)'; owa.init_cgi_env(6,param_names,param_values); sampleowaxml.testone owa.get_page(buf,rows); dbms_lob.createtemporary(outclob,true,dbms_lob.session); for i in 1..rows loop dbms_lob.writeappend(outclob,length(buf(i)),buf(i)); end loop; ? := outclob; ? := DBMS_LOB.INSTR(outclob,CHR(10)&#0124; &#0124;CHR(10));end;</statement>
    <message>ORA-06550: line 3, column 3: PLS-00103: Encountered the symbol "OWA" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "OWA" to continue.</message>
    </xsql-error>
    - <xsql-error action="xsql:include-owa">
    <message />
    </xsql-error>
    </page>
    This error message is very similiar to the message that Shanthir posted on Jan, 21. I did run the dbmslob.sql, but it doesn't help. Anybody has ideas how to solve it?
    I used the PL/SQL web toolkit provided by OAS4.0.8.1. I believe oracle web agent is replaced by this toolkit.
    Thanks,
    Min
    null

    Hi,
    Glad that somebody else too got this problem. Well, as I had mentioned in my previous posting too, I think there are some procedures in the package, dbms_lob, like the writeappend, createtemporary etc.. which is not found in my dbms_lob.sql file, I am using 8.0.5, but I found these procedures in the 8i, I think it is becos of that.
    By the way if anybody got this solution and got any workaround, please help me too.
    I am still waiting for the solution to that.
    Shanthi

  • How to pass multiple parameters while calling a pl/sql procedure based serv

    Hi,
    I have a pl/sql procedure based service that needs to be invoked from the bpel console for testing purpose. This procedure accepts multiple input values which are of varchar2,boolean and datetime data types. How can I get the bpel console to throw a UI where I can enter these values --in other words where(which file and where) can I specify that these are the input parameters that need to be entered along with their types.
    Thanks for yr help!

    Change the payload of the request 'Process WSDL' message type. Change the element of the payload for the RequestMessage to be 'InputParameters' from the XSD generated by the DB Adapter wizard.
    Edit the payload (Element) - Choose 'Project Schema Files'. Select 'InputParameters' from the XSD.
    You can also change the ResponseMessage by doing the same thing, except that you select 'OutputParameters' from the XSD.

  • Obtaining HTML page by issuing a call from a PL/SQL procedure

    Is there any possibility to obtain HTMLDB -> HTML page from a user defined PL/SQL procedure ?
    For example I build an procedure which calls directly
    flows_010500.wwv_flow.show(null,p_flow_step_id=>'2',p_flow_id=>'104')
    and i try to read the result from htp.showpage, but I get a html response page with a security error.
    Maybe is necessary to initialize other parameters?
    Any help?

    Scott, I have got two pages in an application one is login page the other is welcome page. my login page will be process by store proceduer to validate the user based on users table that I have created on my schema. If the user login with username and password, if they exist on this table I will like to send them to welcome page. but I get http://htmldb.oracle.com/pls/otn/wwv_flow.accept.
    The page cannot be found
    The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
    Please try the following:
    If you typed the page address in the Address bar, make sure that it is spelled correctly.
    Open the htmldb.oracle.com home page, and then look for links to the information you want.
    Click the Back button to try another link.
    Click Search to look for information on the Internet.
    HTTP 404 - File not found
    Internet Explorer
    the procedure is below:
    CREATE OR REPLACE PROCEDURE obj_pls_login_chk(p_UserName IN varchar2
    ,p_Password IN varchar2
    ,Login IN varchar2 ) IS
    l_usr_id number;
    l_url varchar2(2000);
    BEGIN
    l_url := 'http://htmldb.oracle.com/pls/otn/f?';
    select user_id into l_usr_id
    from s_cdm_users
    where upper(username) = upper(p_UserName)
    and upper(Password) = upper(p_Password);
    if l_usr_id is not null then
    l_url := l_url||'p=29921:2:4413779570974471450';
    --wwv_flow.show(null,p_flow_step_id=>'29921',p_flow_id=>'29921:2');
    --htp.print(p_UserName);
    end if;
    EXCEPTION
    when others then
    return;
    END

  • Creating a CSV file from a pl/sql procedure

    Hi Everyone,
    I would like to know how to write a procedure in pl/sql where i need to check if they are any records in a table say "Table A".
    If they are any records in the "Table A" then we need to write those records in the "Table A" to the CSV file.
    If they are no records then we need to insert a record into the CSV file that "No records are found in "Table A".
    Could anybody please help ?
    Thanks in advance

    see this
    ops$tkyte@8i> create or replace procedure dump_table_to_csv( p_tname in varchar2,
    2 p_dir in varchar2,
    3 p_filename in varchar2 )
    4 is
    5 l_output utl_file.file_type;
    6 l_theCursor integer default dbms_sql.open_cursor;
    7 l_columnValue varchar2(4000);
    8 l_status integer;
    9 l_query varchar2(1000)
    10 default 'select * from ' || p_tname;
    11 l_colCnt number := 0;
    12 l_separator varchar2(1);
    13 l_descTbl dbms_sql.desc_tab;
    14 begin
    15 l_output := utl_file.fopen( p_dir, p_filename, 'w' );
    16 execute immediate 'alter session set nls_date_format=''dd-mon-yyyy hh24:mi:ss''
    17
    18 dbms_sql.parse( l_theCursor, l_query, dbms_sql.native );
    19 dbms_sql.describe_columns( l_theCursor, l_colCnt, l_descTbl );
    20
    21 for i in 1 .. l_colCnt loop
    22 utl_file.put( l_output, l_separator || '"' || l_descTbl(i).col_name || '"'
    23 dbms_sql.define_column( l_theCursor, i, l_columnValue, 4000 );
    24 l_separator := ',';
    25 end loop;
    26 utl_file.new_line( l_output );
    27
    28 l_status := dbms_sql.execute(l_theCursor);
    29
    30 while ( dbms_sql.fetch_rows(l_theCursor) > 0 ) loop
    31 l_separator := '';
    32 for i in 1 .. l_colCnt loop
    33 dbms_sql.column_value( l_theCursor, i, l_columnValue );
    34 utl_file.put( l_output, l_separator || l_columnValue );
    35 l_separator := ',';
    36 end loop;
    37 utl_file.new_line( l_output );
    38 end loop;
    39 dbms_sql.close_cursor(l_theCursor);
    40 utl_file.fclose( l_output );
    41
    42 execute immediate 'alter session set nls_date_format=''dd-MON-yy'' ';
    43 exception
    44 when others then
    45 execute immediate 'alter session set nls_date_format=''dd-MON-yy'' ';
    46 raise;
    47 end;
    48 /
    Procedure created.
    ops$tkyte@8i> exec dump_table_to_csv( 'emp', '/tmp', 'tkyte.emp' );
    PL/SQL procedure successfully completed.

  • Execute CDC mappings from a PL/SQL procedure

    Hi,
    I´m using OWB 11.2.0.2 for Linux. I´ve created some CDC mappings to update cubes with changes coming from other tables and cubes (from the tables that implement those cubes with the relational option). The issues are:
    - The CDC mappings run successfully from the OWB (Project Navigator - Start), but I cannot execute them from a procedure in PL/SQL with the following code:
    PROCEDURE "PROC_RUNCDCMAPPINGS" IS
    --inicializar variables aquí
    RetVal NUMBER;
    P_ENV WB_RT_MAPAUDIT.WB_RT_NAME_VALUES;
    -- ventana principal
    BEGIN
    RetVal:= BARIK.CDC_LOAD_CUBO_RECARGA.MAIN(P_ENV);
    RetVal:= BARIK.CDC_LOAD_CUBO_TOR.MAIN(P_ENV);
    RetVal:= BARIK.CDC_LOAD_CUBO_TOAE.MAIN(P_ENV);
    RetVal:= BARIK.CDC_LOAD_CUBO_VIAJES.MAIN(P_ENV);
    RetVal:= BARIK.CDC_LOAD_CUBO_TICKETINCIDENCIA.MAIN(P_ENV);
    RetVal:= BARIK.CDC_LOAD_CUBO_LIQMONEDERO.MAIN(P_ENV);
    RetVal:= BARIK.CDC_LOAD_CUBOS_LIQTEMPORALES.MAIN(P_ENV);
    COMMIT;
    END;
    It doesn´t report any error (the value for RetVal after execution is 0), but the cubes are not loaded with changes, and the changes stored in the J$_%tables are not consumed.
    Some of the options that may impact in the mappings are:
    - All the CDC are of Simple type
    - There are more than one subscriber to consume the changes, as for some tables, its changes must feed more than one CDC.
    - All the mappings include only one execution unit per mapping.
    - The integration/load template is the default: DEFAULT_ORACLE_TARGET_CT
    Other question is: As I explained, I need more than one subscriber because same updates must be consumed by different CDC mappings, to load different cubes, but I´ve not been able to assign the subscribers to only the tables associated with them, so all the subscribers are subscribed to all the changes in all the CDC tables, but as many of those subscribers never consume the changes of same tables, in the J$_% tables remains the not consumed records, and I haven´t found the way to purge those tables (other than the delete from J$_), nor to assign the tables with the subscribers (so the subscribers are only subscribed to their interested changes, that will be consumed, so the tables will be emptied after the consumption).
    Any help with these problems will be greatly appreciated.
    Tell me if more info is needed to clarify the situation.
    Best regards,
    Ana

    Hi David,
    Thank you for your reply.
    These mappings are the mappings needed to update the cubes with the changes detected by the CDC system, they are located under the Mapping Templates folder and I´m using code templates for the control of the loading and the integration (the DEFAULT_ORACLE_TARGET_CT) mapping.
    What I need is to execute these mappings within a PL/SQL procedure that will be invoked from different tools.
    I´ve done it for regular mappings (not CDC mappings), and it works. The code is the same as for the CDC ones:
    PROCEDURE "PROC_RUNLOADMAPPINGS" IS
    --inicializar variables aquí
    RetVal NUMBER;
    P_ENV WB_RT_MAPAUDIT.WB_RT_NAME_VALUES;
    -- ventana principal
    BEGIN
    RetVal:= BARIK.LOAD_CUBO_RECARGA.MAIN(P_ENV);
    RetVal:= BARIK.LOAD_CUBO_TOR.MAIN(P_ENV);
    RetVal:= BARIK.LOAD_CUBO_TOAE.MAIN(P_ENV);
    RetVal:= BARIK.LOAD_CUBO_VIAJES.MAIN(P_ENV);
    RetVal:= BARIK.LOAD_CUBO_TICKETINCIDENCIA.MAIN(P_ENV);
    COMMIT;
    END;
    -- End of PROC_RUNLOADMAPPINGS;
    ,and when I run it, the mappings are executed, but with the CDC ones it doesn´t (even when no error is reported).
    I know that they are deployed in the selected agent (in my case the Default_Agent), but when I start them from the OWB, the mapping packages are created in the DB schema, so, I thought that maybe I could invoke them....so what you tell me is that the only way to invoke them is from SQL*Plus? not from a regular PL/SQL procedure?
    Thank you very much,
    Ana

  • Generating an xml from a pl/sql procedure

    Hi Friends,
    I have come up with a requirement to generate an xml from a pl/sql procedure.
    I did some R & D and also got some sample procedures but could not understand the datatypes being used.
    The procedure declares variables like this:
    doc                  xmldom.DOMDocument;
    mainNode         xmldom.DOMNode;
    headerElem      xmldom.DOMElement; Pls could anyone tell what do these xmldom.DOMDocument, xmldom.DOMNode and xmldom.DOMElement mean?
    Later in the procedure, these variables are assigned values like
    doc      := xmldom.newDOMDocument;
    mainNode := xmldom.makenode(doc); This went a bouncer on me.
    Pls help.
    Thanks in advance ...!

    You can check this one -- Learned this from michael.
    satyaki>
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    satyaki>
    satyaki>
    satyaki>with person_h
      2  as
      3    (
      4      select 1 id, 'M' gender, 'W' race, '170' weight from dual union all
      5      select 1, 'M', 'W', '170' from dual union all
      6      select 1, 'M', 'W', '180' from dual union all
      7      select 1, 'M', NULL, '175' from dual union all
      8      select 1, NULL, 'W', NULL from dual
      9    )
    10    select xmlelement("Person",(
    11                                 select xmlagg(xmlelement("Sex", gender))
    12                                 from (
    13                                        select distinct gender
    14                                        from person_h
    15                                        where id = 1
    16                                        and gender is not null
    17                                      ) pg
    18                                ),
    19                                (
    20                                  select xmlagg(xmlforest(race as "Race"))
    21                                  from (
    22                                         select distinct race
    23                                         from person_h
    24                                         where id = 1
    25                                       ) pg
    26                                ),
    27                                (
    28                                  select xmlagg(xmlforest(weight as "Weight"))
    29                                  from (
    30                                         select distinct weight
    31                                         from person_h
    32                                         where id = 1
    33                                       ) pg
    34                                 )
    35                     ).getstringval() Res
    36    from dual;
    RES
    <Person><Sex>M</Sex><Race>W</Race><Weight>170</Weight><Weight>175</Weight><Weight>180</Weight></Person>
    satyaki>Regards.
    Satyaki De.

  • How to pass variable to content area from a PL/SQL procedure

    Hi,
    Can somebody tell me how to create a(Content area) folder based on a PL/SQL procedure that takes a variable as a
    parameter and returns data based on value of that parameter to the folder . Any help would be appreciated .
    Thanks and regards.
    Neeti.

    Somewhere, in one procedure, build a session identifier and save your variable there. If no session with that identifier is previously stored, it will create a new session instance with that ID for you.
    declare
    l_sess portal30.wwsto_api_session;
    varvalue number;
    begin
    varvalue := 100;
    l_sess := portal30.wwsto_api_session.load_session('MYSESSION','VARIABLES');
    l_sess.set_attribute('VAR_NAME',varvalue);
    l_sess.save_session;
    end;
    In your other procedure, or anywhere else needed within that same session, simply load the session and reference the variable. To reference the variable, use the following.
    -- assuming new procedure, so re-defining session variable and reloading session into it
    declare
    my_session portal30.wwsto_api_session;
    my_new_variable number;
    begin
    my_session := portal30.wwsto_api_session.load_session('MYSESSION','VARIABLES');
    my_new_variable := my_session.get_attribute_as_number('VAR_NAME');
    end;
    This will let you reference parameters across multiple portal applications and indirect calls.

  • How to download output from a PL/SQL Procedure

    Hi all
    I have set up a PL/SQL procedure that sets up the mime type etc.
    to download the output but IE keeps telling me it can't get the
    file. I think that it's something to do with the browser wanting
    to just GET the file and getting extra stuff because the mime
    header is being sent every time. Anyone managed to do this?
    Code sample follows:
    create or replace procedure x
    is
    begin
    owa_util.mime_header('application/force-download',false,null);
    htp.p('Content-Disposition: attachment;
    filename="timeline.html"');
    htp.p('Pragma: no-cache');
    htp.p('Cache-Control: no-cache');
    htp.p('Expires: Thu, 01 Jan 1970 12:00:00 GMT');
    owa_util.http_header_close;
    htp.p('<HTML>');
    htp.p('<body>');
    htp.p('Hello there man');
    htp.p('</body>');
    htp.p('</HTML>');
    end;

    What version are you on?
    Works fine for me on my 11g:
    SQL> create or replace procedure testxml (clob_out out clob)
      2  is
      3     l_clob   clob;
      4     l_ctx    dbms_xmlquery.ctxhandle;
      5  begin
      6     l_ctx := dbms_xmlquery.newcontext ('select * from dual');
      7     l_clob := dbms_xmlquery.getxml (l_ctx);
      8     clob_out := l_clob;
      9     dbms_xmlquery.closecontext (l_ctx);
    10  end testxml;
    11  /
    Procedure created.
    SQL>
    SQL> variable vout clob;
    SQL>
    SQL> exec testxml (:vout)
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print vout
    VOUT
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <DUMMY>X</DUMMY>
       </ROW>
    </ROWSET>But definitely you can optimize your proc a bit: Try
    create or replace procedure testxml (clob_out in out nocopy clob)
    is
       l_ctx    dbms_xmlquery.ctxhandle;
    begin
       l_ctx := dbms_xmlquery.newcontext ('select * from dual');
       clob_out := dbms_xmlquery.getxml (l_ctx);
       dbms_xmlquery.closecontext (l_ctx);
    end testxml;
    /

  • Passing value from ADF to BPEL, and to PL/SQL  procedure

    1. I have created BPEL which take 2 inputs and concatenate them.
    2. have created a PL/SQL procedure for invoking this BPEL( working fine).
    Now i need to create a simple ADF page which contain 2 text box, 2 for input and 1 for result(concatenate), this will take 2 inputs and send them into BPEL, this will invoke the BPEL process and perform the necessary concatenate function...
    in addition to this, i am passing code into PL/SQL procedure ...
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body xmlns:ns1="http://xmlns.oracle.com/OrderImportDemo">
    <ns1:InputRequest>
    <ns1:FirstName>abcdef</ns1:FirstName>
    <ns1:LastName>aaaaaa</ns1:LastName>
    </ns1:InputRequest>
    </soap:Body>
    </soap:Envelope>';
    this code will take vaule from BPEL and run properly.
    can you please help me,

    thanks for help, but the problem is diff.
    i don't have any schema, what i want i need to create a adf page that will contain 3 tent field, 2 for input and 1 for output. when i will enter 2 input field and click on ok button, this will invoke BPEL, BPEL will take these 2 inputs and do the concat on this and send back to adf with result.

Maybe you are looking for

  • Help with data recovery on failed MBP HD Please

    Hello My MacBook Pro 160 GB froze the other night and I had to hard reset it. Ever since I have not been able to turn it on and log into the OS (Mountain Lion). All I could do was get the Apple logo when you turn the MacBook on or a folder with a que

  • Install BootCamp update 4.0 on Windows 7 x64 returns error

    Hello, I have a problem updating BootCamp software on Windows. Updating from 3.2 to 3.3 or 4.0, from ASU or from manual installation, returns this: https:// picasaweb.google.com/lh/photo/-w77Vf1cQrlarNb_LUz7fNct5nxxnOU3qWXwGpPvXwI?feat=directlink (sp

  • What features do you need in a LabVIEW build tool?

    When developing LabVIEW applications, libraries, and components often ones needs many more features than the Application Builder provides. For example: * excluding certain directories from the build * defining custom destinations for specific source

  • VSphere Port Mirror - Possible Bug Found

    Hi, Something i came across to and thought could be worth while reporting it since i havent seen any reference to it elsewhere: We've configured a few "source remote port mirror rules" for a few VMs, in a way that each VM had 3 vNics that were mirror

  • Can numbers sort by more than one column? How?

    Can numbers sort by more than one column? How?