AQ$_JMS_TEXT_MESSAGE

Hi,
I'm currently trying to 'migrate' one of our applications to the 10g Express Edition.
Everything went smoothly and was easy enough.
But then I encountered a problem with one of our pl/sql packages that is accessing the aq$_jms_text_message pl/sql type.
The following piece of code is a stripped down version that re-produces the problem.
<----snip--->
declare
msg sys.aq$_jms_text_message;
begin
msg := sys.aq$_jms_text_message.construct;
end;
<---snip--->
generates
ORA-06550: line 4, column 35:
PLS-00302: component 'CONSTRUCT' must be declared
ORA-06550: line 4, column 3:
PL/SQL: Statement ignored
This is also true, if I log on as sys.
I issued the following query to find out what's wrong:
<--- snip --->
select * from all_type_methods where type_name like '%JMS%';
<--- snip --->
and it just returned three lines for AQ$_JMS_HEADER. On the 9.2.0.5 database that we use in production significantly more line were returned and I currently have no access to out 10g development system, but we never had problems on that either.
So my question is: Is this an issue with the 10g Express Edition or is there something else I have to do?
Thanks for any help,
Torsten

AQ is supported in Standard Editon One, Standard Edition and Enterprise Edition.
The web page you pointed to lacks some detail - the best reference for what is and is not in the different editions if the Family of Products whitepaper, available at http://www.oracle.com/technology/products/database/oracle10g/pdf/twp_general_10gdb_product_family_0605.pdf
Note that we will be updating this shortly for Oracle Database Express Edition
To the problem at hand - What you are actually using is the AQ interface to JMS (or Java Message Service). This is not supported in Oracle Database 10g Express Edition.

Similar Messages

  • Can not dequeue JMS message of type SYS.AQ$_JMS_TEXT_MESSAGE using DBMS_AQ

    I'm having a problem using DBMS_AQ package to dequeue a JMS message of type SYS.AQ$_JMS_TEXT_MESSAGE that was put on the queue using Java JMS API.
    Both JMS header and payload return empty but if I do "select user_data" from the queue table, I can see the message.
    Appreciate any helps or tips.
    Kim

    This has been asked a lot of times - I'm not sure how my initial searching missed all of the other questions/answers related to this topic.
    In our case, the solution was to:
    1) Leave the queue as a sys.aq$_jms_text_message type
    2) Construct a sys.xmltype object with our desired payload
    3) Do a getStringVal() on the xmltype object and use that string as the payload for our queue message
    - Nathan

  • PL/SQL Callback notification with aq$_jms_text_message

    Hi,
    i want to set up a notfication for a pl/sql callback procedure. The message in my queue is enqueued via propagation from another instance. This is my setup (using oracle 10.2.0.3):
    -------- the queue (multiconsumer): --------------
    begin
    dbms_aqadm.create_queue_table(queue_table => 'zmon_evt_in_qtable',queue_payload_type => 'sys.aq$_jms_text_message', multiple_consumers => true);
    dbms_aqadm.create_queue(queue_name => 'zmon_evt_in_queue',queue_table => 'zmon_evt_in_qtable' );
    dbms_aqadm.start_queue( queue_name =>'zmon_evt_in_queue' );
    end;
    -------- the callback-procedure (simply inserting an entry in a table called 'test'): --------------
    create or replace procedure evt_in_callback(
    context IN RAW,
    reginfo IN SYS.AQ$_REG_INFO,
    descr IN SYS.AQ$_DESCRIPTOR,
    payload IN VARCHAR2,
    payloadl IN NUMBER) is
    begin
    insert into test(textfeld) values ('RECEIVED!');
    commit;
    end evt_in_callback;
    -------- the subscriber: --------------
    begin
    dbms_aqadm.add_subscriber(queue_name => 'zmon.zmon_evt_in_queue',
    subscriber => sys.aq$_agent('zmon_evt_in_subscriber',null,null));
    end;
    -------- the notification: --------------
    declare
    reginfo sys.aq$_reg_info;
    reg_list sys.aq$_reg_info_list;
    begin
    reginfo := sys.aq$_reg_info(name => 'zmon.zmon_evt_in_queue:zmon_evt_in_subscriber',
    namespace => DBMS_AQ.NAMESPACE_AQ,
    callback => 'plsql://zmon.evt_in_callback',
    context => HEXTORAW('FF')
    reg_list := sys.aq$_reg_info_list(reginfo);
    DBMS_AQ.REGISTER(reg_list => reg_list,
    reg_count => 1);
    end;
    The callback-procedure is not fired on arrival of a message in the queue. But i can see the the appropriate notfication-entry in sys.reg$.
    Any suggestions why this doesn't work ?
    BTW: can anybody tell me the meaning of the context-Parameter in the aq$_reg_info-Type ? Everybody uses HEXTORAW('FF'), but I don't understand what that means...
    Jens
    Edited by: dschenzl on Jun 4, 2009 11:13 AM

    Finally, it's done.
    The subscriber used in the propagation has to be the notification-subscriber (zmon_evt_in_subscriber). I used another subscriber, which was not registered for notification.
    I found the solution in this thread: Callback trouble from mesage via propagated message.
    Two days filled up with frustrating work - man, how i hate that...
    Greetings to the community,
    Jens

  • Problem enqueuing with SYS.AQ$_JMS_TEXT_MESSAGE payload

    We are trying to enqueue a message into a SYS.AQ$_JMS_TEXT_MESSAGE AQ from java using the standard AQjmsQueueSender. The message arrives onto the queue but the USER_DATA is always 'oracle.sql.STRUCT@5a41ec' instead of the actual message. When we enqueue from PL/SQL the USER_DATA contains the actual message. Any help would be greatly appreciated. Thanks.
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE     10.2.0.4.0     Production"
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    QUEUE DETAILS
    OWNER:     EIMGR
    QUEUE_TABLE:     AQ_VENDORS_IN_TABLE
    TYPE: OBJECT
    OBJECT_TYPE:     SYS.AQ$_JMS_TEXT_MESSAGE
    SORT_ORDER:     ENQUEUE_TIME
    RECIPIENTS:     SINGLE
    MESSAGE_GROUPING:     NONE
    COMPATIBLE: 8.1.3
    PRIMARY_INSTANCE: 0
    SECONDARY_INSTANCE:     0
    OWNER_INSTANCE:     1
    USER_COMMENT: EI_QUEUE
    SECURE:     NO
    CREATED:     09-09-03
    LAST_DDL_TIME: 09-09-03
    -------------------------------------------------------------------------------------

    We've discovered with PL/SQL that setting any headers on messages causes the same problem that we're seeing from JAVA. There is no option in JAVA to send messages without headers (it's part of the JMS spec). This can be seen with the following PL/SQL script (use null instead of HEADER in the message constructor to see it work):
    DECLARE
    Enqueue_options DBMS_AQ.enqueue_options_t;
    Message_properties DBMS_AQ.message_properties_t;
    Message_handle RAW(16);
    User_prop_array SYS.AQ$_JMS_USERPROPARRAY;
    Agent SYS.AQ$_AGENT;
    Header SYS.AQ$_JMS_HEADER;
    Message SYS.AQ$_JMS_TEXT_MESSAGE;
    Message_text VARCHAR2(500);
    BEGIN
    Agent := SYS.AQ$_AGENT('',NULL,0);
    User_prop_array := SYS.AQ$_JMS_USERPROPARRAY();
    Header := SYS.AQ$_JMS_HEADER( Agent, '', 'dave', '', '', '', User_prop_array);
    Message_text := 'Message from PL/SQL created at '|| TO_CHAR(SYSDATE, 'mm/dd/yyyy hh24:mi:ss');
    Message := SYS.AQ$_JMS_TEXT_MESSAGE(Header, LENGTH(Message_text), Message_text, NULL);
    DBMS_AQ.ENQUEUE(queue_name => 'AQ_VENDORS_IN',
    Enqueue_options => enqueue_options,
    Message_properties => message_properties,
    Payload => message,
    Msgid => message_handle);
    COMMIT;
    END;

  • PLSQL Notification on a multi-subscriber queue with sys.aq$_jms_text_messag

    Hi all,
    I am trying to get PLSQL notification working on a multi subscriber queue with sys.aq$jms_text_message as the payload type. The commands to create my queue are as follows:
    dbms_aqadm.create_queue_table(
    queue_table => 'SOA_JMS.RJMTESTxx_QTAB',
    multiple_consumers => true,
    queue_payload_type => 'sys.aq$_jms_text_message'
    dbms_aqadm.create_queue(
    queue_name=>'RJMTESTQ',
    queue_table => 'SOA_JMS.RJMTESTxx_QTAB',
    retention_time => 86400, --Keep processed messages for 24 hours
    max_retries => 3,
    retry_delay => 1
    dbms_aqadm.start_queue('RJMTESTQ');
    dbms_aqadm.add_subscriber(
    queue_name => 'SOA_JMS.RJMTESTQ',
    subscriber => sys.aq$_agent('SUBSCRIP1',null,0),
    rule => NULL,
    transformation => NULL,
    queue_to_queue => FALSE,
    delivery_mode => dbms_aqadm.persistent
    I then create a procedure with the following signature:
    create or replace procedure SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_1(
    p_context in raw,
    p_reginfo in sys.aq$_reg_info,
    p_descr in sys.aq$_descriptor,
    p_payload in raw,
    p_payloadl in number
    And register it as follows:
    reginfo := sys.aq$_reg_info(
    'SOA_JMS.RJMTESTQ:SUBSCRIP1',
    DBMS_AQ.NAMESPACE_AQ,
    'plsql://SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_1?PR=0',
    --utl_raw.cast_to_raw('STANDARDJMS')
    HEXTORAW('FF')
    reg_list := sys.aq$_reg_info_list(reginfo);
    dbms_aq.register(reg_list,1);
    The problem is the notifications are not firing as they should be.
    I have done some tracing and found an error:
    Error in PLSQL notification of msgid:BA964334E5A057A4E040C69BAF397075
    Queue :"SOA_JMS"."RJMTESTQ"
    Consumer Name :SUBSCRIP1
    PLSQL function :SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_1
    : Exception Occured, Error msg:
    ORA-00604: error occurred at recursive SQL level 2
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'EXCEPTION_QUEUE_NOFIFYCB_1'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    This says that the parameters I have for my procedure is wrong. Looking through the documents I think it is something to do with the ?PR=0 used in the register call, but I can’t find any documentation telling me what the required parameters are.
    Does anyone here know?
    Thanks
    Robert

    Hi,
    I have found the solution and I am posting here in case it helps anyone else.
    The paramater names must match the callback not just the types and in/out.
    So the following works:
    create or replace procedure SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_2(
    context in raw,
    reginfo in sys.aq$_reg_info,
    descr in sys.aq$_descriptor,
    payload in raw,
    payloadl in number
    Robert

  • Publishing SYS.aq$_jms_text_message to Oracle Streams Queue

    I've created a streams queue using dbms_streams_adm and by default the payload type for the queue created is Sys.AnyData. How do I publish a message of type aq$_jms_text_message in PL/SQL to this streams Queue. I guess it all comes down to converting aq$_jms_text_message to AnyData in pl/sql. Sys.AnyData does NOT have anything to convert aq$_jms_text_message.
    Any help would be appreciated.
    Thanks,
    Das

    This has been asked a lot of times - I'm not sure how my initial searching missed all of the other questions/answers related to this topic.
    In our case, the solution was to:
    1) Leave the queue as a sys.aq$_jms_text_message type
    2) Construct a sys.xmltype object with our desired payload
    3) Do a getStringVal() on the xmltype object and use that string as the payload for our queue message
    - Nathan

  • Dequeueing a SYS.AQ$_JMS_TEXT_MESSAGE

    I am new to AQ please give me advice
    I created queue with AQ$_JMS_TEXT_MESSAGE and I able to enqueue the message but I am not able to dequeue the message. How do I retrive messages using pl/sql
    Thanks
    Message was edited by:
    sheebaann

    declare
    dequeue_options dbms_aq.dequeue_options_t;
    message_properties dbms_aq.message_properties_t;
    message_handle RAW(16);
    message SYS.AQ$_JMS_MESSAGE;
    begin
    -- dequeue_options.msgid           := MsgId; <----------------Optional
    dequeue_options.dequeue_mode      := DBMS_AQ.REMOVE;
    DBMS_AQ.DEQUEUE(
    queue_name => <Your Q Name>,
    dequeue_options => dequeue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle);
    end;
    Regards,
    Sanjeev.

  • Sys.aq$_jms_text_message type queues message size limitations

    Are there any size limitations for enqueing text messages into a sys.aq$_jms_text_message type queue using AQ?

    yes, i understand how to describe something...
    my question is how to get a list of properties.
    this data type has get functions that take the name of a property. now how do i know that property name to get it?

  • OSB Service with Oracle AQ with payload type SYS.AQ$_JMS_TEXT_MESSAGE

    I am trying to write a web-service to Enqueue/Dequeue messages from an AQ with payload type SYS.AQ$_JMS_TEXT_MESSAGE defined in Oracle DB.
    In my understanding is that I need to create a JMSModule within weblogic with a ForeignServer defined within it to enqueue/dequeue message to/from the AQ.
    I have created Datasource, JMSServer, JMSModule, ForeignServer (created ConnectionFactory with localJNDIName="MyQueueCF" and RemoteJNDIName as "QueueConnectionFactory" and Destination with localJNDIName="MyQueueDest" and RemoteJNDIName="Queues/<queue_name_in_DB>")
    My business service has an endpoint "http://localhost:7001/MyQueueCF/MyQueueDest"
    When I am testing my service to populate message on to the Queue. I get the following error:
    The error was oracle.jms.AQjmsException: Error creating the db_connection
    My questions are:
    * Am I following the correct procedure to talk to AQ with JMS text message type payload?
    * If yes, how can I get around the issue I am stuck with?
    Please help!
    Thanks.
    Edited by: user4696353 on 27-Sep-2011 11:43
    Edited by: user4696353 on 27-Sep-2011 11:49
    Edited by: user4696353 on 27-Sep-2011 12:25

    Example:
    conn / as sysdba
    begin
    dbms_aqadm.create_queue_table
    ( queue_table=> 'SCOTT.AQJMS'
    , queue_payload_type=> 'SYS.AQ$_JMS_TEXT_MESSAGE'
    , compatible=> '9.1'
    end;
    This worked fine for me after a standard DB-installation.

  • How can I use an IF statement in the SELECT

    Hi People,
    I have a procedure called ENQUEUE_PROC which takes 3 parameters.
    and I am trying to use an if statement in the select. I appreciate the help with this task.
    here is my code.
    Please have a look at my Select statement. What I have does not compile, however it might give you an idea of what i need.
    PROCEDURE ENQUEUE_PROC(P_SUBMISSION_ID NUMBER,
                           P_EVENT         VARCHAR2,
                                CASE_TYPE_CODE NUMBER;
                           ) AS
         XMLDATA XMLTYPE;
         enqueue_options     dbms_aq.enqueue_options_t;
         message_properties  dbms_aq.message_properties_t;
         message_handle      RAW(16);
         message SYS.AQ$_JMS_TEXT_MESSAGE;
    BEGIN
              SELECT      
                        XMLELEMENT("caseFileEvent", XMLATTRIBUTES('http://www.ussc.gov/soa/casefile/event/types' AS "xmlns",
                                                          'http://www.ussc.gov/soa/casefile/event/types' AS "xmlns:ns0"),
                             XMLELEMENT("caseFileUploadEvent", XMLATTRIBUTES('http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi",
                                                                                                   'http://www.ussc.gov/soa/casefile/event/types ../xsd/Case_META.xsd' AS "xsi:schemaLocation",
                                                                                                   'http://www.ussc.gov/soa/casefile/event/types' AS "xmlns"),
                                       XMLELEMENT("taskEvent", P_EVENT), --eg - 'SUBMIT', 'REJECT', 'RESUBMIT'
                                XMLELEMENT("defendentDetails",
                                                                XMLELEMENT("sentensingDate", SMD.SENT_VIO_DATE),
                                                                XMLELEMENT("personDetails",
                                                                               // Here is where I want my IF statement, *********************************
                                                                               IF CASE_TYPE_CODE = 10 THEN
                                                                                         XMLELEMENT("personNameDetails",
                                                                                                             XMLELEMENT("firstName", SMD.FIRST_NAME),
                                                                                                             XMLELEMENT("middleName", SMD.MIDDLE_NAME),
                                                                                                             XMLELEMENT("lastName", SMD.LAST_NAME)
                                                                                                   ), -- personNameDetails
                                                                               ELSE
                                                                                    XMLELEMENT("personNameDetails",
                                                                                                   XMLELEMENT("corpname", SMD.CORPNAME),
                                                                                         ), -- personNameDetails
                                                                               XMLELEMENT("dateOfBirth", SMD.BIRTH_DATE)          
                                                                          ) -- personDetails
                                            ), -- defendentDetails
                                            XMLELEMENT("documentStatusDetails",
                                                      XMLELEMENT("otherStatus",
                                                                     XMLELEMENT("intCode", NULL),
                                                                     XMLELEMENT("description", NULL)
                                                                ) -- otherStatus
                                            ), -- documentStatusDetails
                                            XMLELEMENT("uploadOtherDetails",
                                                           XMLELEMENT("submissionId", SUB.SUBMISSION_ID),
                                                           XMLELEMENT("submissionSessionId", SUB.SUB_SESSION_ID),
                                                           XMLELEMENT("submissionMethod",
                                                                XMLELEMENT("intCode", SUB.SUB_MTHD_CODE),
                                                                XMLELEMENT("description", SM.DESCRIP)
                                                           ), -- submissionMethod
                                                           XMLELEMENT("submissionReason",
                            XMLELEMENT("intCode", SUB.SUB_TYPE_CODE),
                                                                XMLELEMENT("description", SR.DESCRIP)
                                                           ), -- submissionReason
                                                           XMLELEMENT("district",
                                                                XMLELEMENT("intCode", SMD.DIST_ID),
                                                                XMLELEMENT("description", D.DISTRICT_NAME)
                                                           ), -- district
                                                           XMLELEMENT("caseFileType",
                                                                XMLELEMENT("intCode", SUB.CASE_TYPE_CODE),
                                                                XMLELEMENT("description", C.DESCRIP)
                                                           ), -- caseFileType
                                                           XMLELEMENT("primaryDocketInfo",
                                                                XMLELEMENT("yearYY", SUBSTR(SMD.DOCKET, 1, 2)),
                                                                XMLELEMENT("id", SUBSTR(SMD.DOCKET, 3, 7)),
                                                                XMLELEMENT("defendentNumber", SMD.DEF_NUM)
                                                           ), -- primaryDocketInfo
                                                           XMLELEMENT("PACTSId", SMD.PACTS_ID), -- PACTSId
                                                           XMLELEMENT("AOJudgeId",
                                                                XMLELEMENT("intCode", SMD.AO_JUDGE_ID),
                                                                XMLELEMENT("description", J.LAST_NAME || ', ' || J.FIRST_NAME || ', ' || J.MIDDLE_NAME)
                                                           ), -- AOJudgeId
                                                           XMLELEMENT("missingCasefile", SUB.MISSING_CASE), -- missingCasefile
                                                           XMLELEMENT("creator",
                                                                XMLELEMENT("firstName", NULL),
                                                                XMLELEMENT("lastName", NULL),
                                                                XMLELEMENT("email", SUB.CREATOR_ID),
                                                                XMLELEMENT("actionDate", REGEXP_REPLACE( TO_CHAR(SUB.CREATE_TIME, 'YYYY-MM-DD"T"HH24:MI:SS.FFTZR'), '...(......)$', '\1'))
                                                           ), -- creator
                                                           XMLELEMENT("lastModifier",
                                                                XMLELEMENT("firstName", NULL),
                                                                XMLELEMENT("lastName", NULL),
                                                                XMLELEMENT("email", H.USER_ID),
                                                                XMLELEMENT("actionDate", TO_CHAR(H.ACTION_DATE, 'YYYY-MM-DD"T"HH24:MI:SS".000-05:00"'))
                                                           ) -- lastModifier
                                            ) -- uploadOtherDetails
                             ) -- caseFileUploadEvent
                        ) -- caseFileEvent
              INTO      XMLDATA
              FROM      USSC_CASES.SUBMISSION SUB,
              USSC_CASES.SUBMISSION_METADATA SMD,
              USSC_CASES.CASE_HISTORY H,
              LOOKUP.CASE_SUB_MTHD SM,
              LOOKUP.CASE_SUB_TYPE SR,
              LOOKUP.DISTRICTS D,
              LOOKUP.JUDGES J,
              LOOKUP.CASE_TYPES C
              WHERE      SUB.SUBMISSION_ID = SMD.SUBMISSION_ID
              AND        SUB.SUBMISSION_ID = H.SUBMISSION_ID
              AND        SUB.SUB_MTHD_CODE = SM.SUBMTHD_CODE
              AND        SUB.SUB_TYPE_CODE = SR.SUBTYPE_CODE
              AND        SUB.CASE_TYPE_CODE = C.CASE_TYPE_CODE
              AND        SMD.DIST_ID = D.USSC_DISTRICT_ID
              AND        SMD.AO_JUDGE_ID = J.AO_JUDGE_ID
              AND        H.ACTION_DATE IN (SELECT MAX(A.ACTION_DATE)
                                  FROM USSC_CASES.CASE_HISTORY A
                                  WHERE A.SUBMISSION_ID = P_SUBMISSION_ID)
              AND        SUB.SUBMISSION_ID = P_SUBMISSION_ID;
        --dbms_output.put_line('queue start '|| xmldata.getclobval());
        --insert into test1 values(xmldata);
        message := SYS.AQ$_JMS_TEXT_MESSAGE.construct;
        message.set_text(xmldata.getStringVal());
        DBMS_AQ.ENQUEUE(queue_name => 'case_file_queue',  -- aqadm.cases_queue             
        enqueue_options    => enqueue_options,       
        message_properties => message_properties,     
        payload  => message,             
        msgid   => message_handle);
         COMMIT;
    END ENQUEUE_PROC;

    thanks for the help,
    I believe I almost got it to compilw, however I am getting Error(29,19): PL/SQL: ORA-00918: column ambiguously defined.
    Of course CASE_TYPE_CODE is ambiguously because its passed in, is there a way around this.
    Here is what i have so far.
    PROCEDURE ENQUEUE_PROC(P_SUBMISSION_ID NUMBER,
                           P_EVENT         VARCHAR2,
                           CASE_TYPE_CODE NUMBER    // passed in field
                           ) AS
         XMLDATA XMLTYPE;
         enqueue_options     dbms_aq.enqueue_options_t;
         message_properties  dbms_aq.message_properties_t;
         message_handle      RAW(16);
         message SYS.AQ$_JMS_TEXT_MESSAGE;
    BEGIN
              SELECT      
                        XMLELEMENT("caseFileEvent", XMLATTRIBUTES('http://www.ussc.gov/soa/casefile/event/types' AS "xmlns",
                                                          'http://www.ussc.gov/soa/casefile/event/types' AS "xmlns:ns0"),
                             XMLELEMENT("caseFileUploadEvent", XMLATTRIBUTES('http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi",
                                                                                                   'http://www.ussc.gov/soa/casefile/event/types ../xsd/Case_META.xsd' AS "xsi:schemaLocation",
                                                                                                   'http://www.ussc.gov/soa/casefile/event/types' AS "xmlns"),
                                       XMLELEMENT("taskEvent", P_EVENT), --eg - 'SUBMIT', 'REJECT', 'RESUBMIT'
                                            XMLELEMENT("defendentDetails",
                                                                XMLELEMENT("sentensingDate", SMD.SENT_VIO_DATE),
                                                                CASE
                                                                     WHEN CASE_TYPE_CODE = 10 THEN
                                                                           XMLELEMENT("personDetails",
                                                                                         XMLELEMENT("personNameDetails",
                                                                                                             XMLELEMENT("firstName", SMD.FIRST_NAME),
                                                                                                             XMLELEMENT("middleName", SMD.MIDDLE_NAME),
                                                                                                             XMLELEMENT("lastName", SMD.LAST_NAME)
                                                                                                   ), -- personNameDetails 
                                                                                         XMLELEMENT("dateOfBirth", SMD.BIRTH_DATE)          
                                                                                    ) -- personDetails
                                                                     ELSE
                                                                          XMLELEMENT("corporationDetails",
                                                                                         XMLELEMENT("organizationName", SMD.CORP_NAME)
                                                                                    ) -- corporationDetails          
                                                                END
                                            ), -- defendentDetails
                                            XMLELEMENT("documentStatusDetails",
                                                      XMLELEMENT("otherStatus",
                                                                     XMLELEMENT("intCode", NULL),
                                                                     XMLELEMENT("description", NULL)
                                                                ) -- otherStatus
                                            ), -- documentStatusDetails
                                            XMLELEMENT("uploadOtherDetails",
                                                           XMLELEMENT("submissionId", SUB.SUBMISSION_ID),
                                                           XMLELEMENT("submissionSessionId", SUB.SUB_SESSION_ID),
                                                           XMLELEMENT("submissionMethod",
                                                                XMLELEMENT("intCode", SUB.SUB_MTHD_CODE),
                                                                XMLELEMENT("description", SM.DESCRIP)
                                                           ), -- submissionMethod
                                                           XMLELEMENT("submissionReason",
                                                                XMLELEMENT("intCode", SUB.SUB_TYPE_CODE),
                                                                XMLELEMENT("description", SR.DESCRIP)
                                                           ), -- submissionReason
                                                           XMLELEMENT("district",
                                                                XMLELEMENT("intCode", SMD.DIST_ID),
                                                                XMLELEMENT("description", D.DISTRICT_NAME)
                                                           ), -- district
                                                           XMLELEMENT("caseFileType",
                                                                XMLELEMENT("intCode", SUB.CASE_TYPE_CODE),
                                                                XMLELEMENT("description", C.DESCRIP)
                                                           ), -- caseFileType
                                                           XMLELEMENT("primaryDocketInfo",
                                                                XMLELEMENT("yearYY", SUBSTR(SMD.DOCKET, 1, 2)),
                                                                XMLELEMENT("id", SUBSTR(SMD.DOCKET, 3, 7)),
                                                                XMLELEMENT("defendentNumber", SMD.DEF_NUM)
                                                           ), -- primaryDocketInfo
                                                           XMLELEMENT("PACTSId", SMD.PACTS_ID), -- PACTSId
                                                           XMLELEMENT("AOJudgeId",
                                                                XMLELEMENT("intCode", SMD.AO_JUDGE_ID),
                                                                XMLELEMENT("description", J.LAST_NAME || ', ' || J.FIRST_NAME || ', ' || J.MIDDLE_NAME)
                                                           ), -- AOJudgeId
                                                           XMLELEMENT("missingCasefile", SUB.MISSING_CASE), -- missingCasefile
                                                           XMLELEMENT("creator",
                                                                XMLELEMENT("firstName", NULL),
                                                                XMLELEMENT("lastName", NULL),
                                                                XMLELEMENT("email", SUB.CREATOR_ID),
                                                                XMLELEMENT("actionDate", REGEXP_REPLACE( TO_CHAR(SUB.CREATE_TIME, 'YYYY-MM-DD"T"HH24:MI:SS.FFTZR'), '...(......)$', '\1'))
                                                           ), -- creator
                                                           XMLELEMENT("lastModifier",
                                                                XMLELEMENT("firstName", NULL),
                                                                XMLELEMENT("lastName", NULL),
                                                                XMLELEMENT("email", H.USER_ID),
                                                                XMLELEMENT("actionDate", TO_CHAR(H.ACTION_DATE, 'YYYY-MM-DD"T"HH24:MI:SS".000-05:00"'))
                                                           ) -- lastModifier
                                            ) -- uploadOtherDetails
                             ) -- caseFileUploadEvent
                        ) -- caseFileEvent
              INTO      XMLDATA
              FROM      USSC_CASES.SUBMISSION SUB,
              USSC_CASES.SUBMISSION_METADATA SMD,
              USSC_CASES.CASE_HISTORY H,
              LOOKUP.CASE_SUB_MTHD SM,
              LOOKUP.CASE_SUB_TYPE SR,
              LOOKUP.DISTRICTS D,
              LOOKUP.JUDGES J,
              LOOKUP.CASE_TYPES C
              WHERE      SUB.SUBMISSION_ID = SMD.SUBMISSION_ID
              AND        SUB.SUBMISSION_ID = H.SUBMISSION_ID
              AND        SUB.SUB_MTHD_CODE = SM.SUBMTHD_CODE
              AND        SUB.SUB_TYPE_CODE = SR.SUBTYPE_CODE
              AND        SUB.CASE_TYPE_CODE = C.CASE_TYPE_CODE
              AND        SMD.DIST_ID = D.USSC_DISTRICT_ID
              AND        SMD.AO_JUDGE_ID = J.AO_JUDGE_ID
              AND        H.ACTION_DATE IN (SELECT      MAX(A.ACTION_DATE)
                                                 FROM      USSC_CASES.CASE_HISTORY A
                                                 WHERE      A.SUBMISSION_ID = P_SUBMISSION_ID)
              AND        SUB.SUBMISSION_ID = P_SUBMISSION_ID;
        --dbms_output.put_line('queue start '|| xmldata.getclobval());
        --insert into test1 values(xmldata);
        message := SYS.AQ$_JMS_TEXT_MESSAGE.construct;
        message.set_text(xmldata.getStringVal());
        DBMS_AQ.ENQUEUE(queue_name => 'case_file_queue',  -- aqadm.cases_queue             
        enqueue_options    => enqueue_options,       
        message_properties => message_properties,     
        payload  => message,             
        msgid   => message_handle);
         COMMIT;
    END ENQUEUE_PROC;Edited by: Rooney on Jan 31, 2012 1:55 PM

  • Oracle AQ to JMS Queue which is on Oracle Application server

    Hi,
    I am using Oracle Streams AQ Oracle database 10g
    and i have a JMS Queue on oracle Application server.
    how i can Propagate message from Oracle AQ (AQ$_JMS_TEXT_MESSAGE)Queue to JMS Queue. ?
    Thanks,
    Satnani

    Hi Justin,
    Thanks for Reply, but in my case my JMS queue is on Oracle Application Server.
    and i want to propagate message from AQ to JMS queue.
    and none of the document is available to describe how to send message from oracle database AQ to JMS queue which is on application server.
    please help
    Thanks,
    Satnani

  • Issue in dequeuing messages on Linux using AQjmsTextMessage_C.getFactory().

    Hi All,
    This is regarding issue related to Dequeuing of message from AQ on Linux platform using JAVA API. Our appliaction is sending message on AQ which has queue payload type of type 'SYS.AQ$_JMS_TEXT_MESSAGE'. For dequeuing of this message we are using method AQjmsTextMessage_C.getFactory() that returns CustomDatumFactory.
    The code snippet is as follows:
    AQDequeueOption dequeueOption = new AQDequeueOption();
    message = ((AQOracleQueue)l_queue).dequeue(dequeueOption,AQjmsTextMessage_C.getFactory());
    The code is working fine on Windows environment. I ran the code from JDev IDE and also from batch file which was hitting the Oracle AQ installed on Linux environment. In both the case either through IDE or through batch file the code is running properly.
    The same code on Linux is not working properly i.e. when the method AQjmsTextMessage_C.getFactory() is called we are not able to get the CustomDatumFactory. We are not getting any errors/exceptions and the control is directly going to finally block of our method and we are not getting the message from AQ. We tried with different jar files that contain the AQjmsTextMessage_C class but still not able to figure out the issue(The jar files used are viz. aqapi.jar,aqapi12.jar,aqapi13.jar,aqapi_g.jar,aqapi12_g.jar,aqapi13_g.jar).
    The script that we used for creating the queue is as follows:
    BEGIN
    dbms_aqadm.create_queue_table(
    queue_table=>'SAMPLE_T',
    queue_payload_type=>'SYS.AQ$_JMS_TEXT_MESSAGE',
    multiple_consumers => false,
    comment => 'Queue Table For Text Message'
    END;
    BEGIN
    dbms_aqadm.create_queue (
    queue_name => 'SAMPLE_Q',
    queue_table => 'SAMPLE_T');
    END;
    BEGIN
    dbms_aqadm.start_queue (queue_name=>'SAMPLE_Q');
    END;
    Please let me know if you have faced such issue on Linux environment or have any pointers about the same.
    Regards,
    Abhishek

    If "control is directly going to finally block" there must be some (unchecked) runtime exception. Catch it.
    try{
      AQDequeueOption dequeueOption = new AQDequeueOption();
      message = ((AQOracleQueue)l_queue).dequeue(dequeueOption,AQjmsTextMessage_C.getFactory());
    } catch (Throwable t) {
      t.printStackTrace()
    }You probably just don't have native code in the library path.

  • Backup/Recovery from web application

    Hello guys,
    I am using Oracle 9i as DB and Oracle 9iAS for web application server. I want to provide Backup and Recovery functionality to the user via web. I don't know any thing in this regard.
    Is it possible that we can take backup and recovery from web application?
    Is there any alternative for this function.
    any other comments will be appreciated.
    Thank you,
    Jawed Nazar Ali

    Read this article in order to get an idea about Java Stored Procedures.
    Oracle Developer JAVA STORED PROCEDURES
    Simplify with Java Stored Procedures
    By Kuassi Mensah
    Use Java stored procedures to bridge SQL, XML, Java, and J2EE and Web Services.
    Stored procedures allow a clean separation of persistence logic that runs in the database tier from business logic that runs in the middle tier. This separation reduces overall application complexity and increases reuse, security, performance, and scalability.
    A major obstacle, however, for widespread adoption of stored procedures is the set of various proprietary, database-dependent implementation languages that different database vendors use. The use of Java-based stored procedures fixes this concern. Oracle has implemented ANSI standards that specify the ability to invoke static Java methods from SQL as procedures or functions. This implementation is called simply "Java stored procedures."
    In this article, you will learn how Java stored procedures help simplify and increase the performance of your business logic and extend database functionality. I'll show how Oracle enables the use of Java stored procedures within the database. I'll also look at how Java stored procedures access data, and show how to create a basic Java stored procedure.
    PL/SQL or Java
    When you think of Oracle stored procedures, you probably think of PL/SQL. Oracle, however, has provided Java support in the database since Oracle8i, to offer an open and portable alternative to PL/SQL for stored procedures. I can hear the $64,000 question: "How do I choose between PL/SQL and Java? Should I forget all the things I've been told about PL/SQL and move on to the greener Java pastures?"
    Both languages are suitable for database programming, and each has its strengths and weaknesses. In deciding which language to use, here's a general rule of thumb:
    Use PL/SQL for database-centric logic that requires seamless integration with SQL and therefore complete access to database objects, types, and features.
    Use Java as an open alternative to PL/SQL for database independence, but also for integrating and bridging the worlds of SQL, XML, J2EE, and Web services.
    OracleJVM Lets You Run Java within the Database
    Since Oracle8i, Release 1 (Oracle 8.1.5), Oracle has offered a tightly integrated Java virtual machine (JVM) that supports Oracle's database session architecture. Any database session may activate a virtually dedicated JVM during the first Java code invocation; subsequent users then benefit from this already Java-enabled session. In reality, all sessions share the same JVM code and statics—only private states are kept and garbage collected in an individual session space, to provide Java sessions the same session isolation and data integrity capabilities as SQL operations. There is no need for a separate Java-enabled process for data integrity. This session-based architecture provides a small memory footprint and gives OracleJVM the same linear SMP scalability as the Oracle database.
    Creating Java Stored Procedures
    There are a few steps involved in turning a Java method into a Java stored procedure. These include loading the Java class into the database using the loadjava utility, and publishing the Java methods using a call specification (Call Spec) to map Java methods, parameter types, and return types to their SQL counterparts. The following section shows how to do this.
    I'll use a simple Hello class, with one method, Hello.world(), that returns the string "Hello world":
    public class Hello
    public static String world ()
    return "Hello world";
    The Loadjava Utility
    Loadjava is a utility for loading Java source files, Java class files, and Java resource files; verifying bytecodes; and deploying Java classes and JAR files into the database. It is invoked either from the command line or through the loadjava() method contained within the DBMS_JAVA class. To load our Hello.class example, type:
    loadjava -user scott/tiger Hello.class
    As of Oracle9i Release 2, loadjava allows you to automatically publish Java classes as stored procedures by creating the corresponding Call Specs for methods contained in the processed classes. Oracle provides Oracle9i JDeveloper for developing, testing, debugging, and deploying Java stored procedures.
    The Resolver Spec
    The JDK-based JVM looks for and resolves class references within the directories listed in the CLASSPATH. Because Oracle database classes live in the database schema, the OracleJVM uses a database resolver to look for and resolve class references through the schemas listed in the Resolver Spec. Unlike the CLASSPATH, which applies to all classes, the Resolver Spec is applied on a per-class basis. The default resolver looks for classes first in the schema in which the class is loaded and then for classes with public synonyms.
    loadjava -resolve <myclass>
    You may need to specify different resolvers, and you can force resolution to occur when you use loadjava, to determine at deployment time any problems that may occur later at runtime.
    loadjava -resolve -resolver "((* SCOTT) (foo/bar/* OTHERS)
    (* PUBLIC))"
    Call Spec and Stored Procedures Invocation
    To invoke a Java method from SQL (as well as from PL/SQL and JDBC), you must first publish the public static method through a Call Spec, which defines for SQL the arguments the method takes and the SQL types it returns.
    In our example, we'll use SQL*Plus to connect to the database and define a top-level Call Spec for Hello.world():
    SQL> connect scott/tiger
    SQL> create or replace function helloworld return
    VARCHAR2 as language java name 'Hello.world () return
    java.lang.String';
    Function created.
    You can then invoke the Java stored procedure as shown below:
    SQL> variable myString varchar2[20];
    SQL> call helloworld() into :myString;
    Call completed.
    SQL> print myString;
    MYSTRING
    Hello world
    Java stored procedures are callable, through their Call Spec, from SQL DML statements (INSERT, UPDATE, DELETE, SELECT, CALL, EXPLAIN PLAN, LOCK TABLE, and MERGE), PL/SQL blocks, subprograms, and packages, as well as database triggers. The beauty of Call Spec is that stored procedure implementations can change over time from PL/SQL to Java or vice versa, transparently to the requesters.
    Call Spec abstracts the call interface from the implementation language (PL/SQL or Java) and therefore enables sharing business logic between legacy applications and newer Java/J2EE-based applications. At times, however, when invoking a database-resident Java class from a Java client, you may not want to go through the PL/SQL wrapper. In a future release, Oracle plans to provide a mechanism that will allow developers to bypass the Call Spec.
    Advanced Data-Access Control
    Java stored procedures can be used to control and restrict access to Oracle data by allowing users to manipulate the data only through stored procedures that execute under their invoker's privileges while denying access to the table itself. For example, you can disable updates during certain hours or give managers the ability to query salary data but not update it, or log all access and notify a security service.
    Sharing Data Logic Between Legacy and J2EE Applications
    Because legacy applications and J2EE applications both invoke stored procedures through the Call Spec, the same data logic can be shared between J2EE and non-J2EE worlds. Thanks to Call Spec, this data logic can be shared regardless of the implementation language used (whether PL/SQL or Java).
    Autogeneration of Primary Keys for BMP Entity Beans
    When using BMP for EJB entity beans, a bean instance can be uniquely identified by the auto-generated primary key associated with the newly inserted data as a return value for ejbCreate(). You can retrieve this value within ejbCreate() in one database operation by using a stored procedure that inserts the corresponding data and retrieves or computes the primary key. Alternatively, you could insert the data and retrieve the corresponding key (or ROWID) in one SQL statement, using the RETURN_GENERATED_KEYS feature in JDBC 3.0. However, the stored procedure approach is more portable across JDBC driver versions and databases.
    You can implement this pattern with these three steps:
    Create the Java stored procedure, defining a public static Java method insertAccount() within a public GenPK class. This method will insert data, compute a unique key (by passing out a sequence number), and return the computed key as primary key.
    Define the Call Spec.
    CREATE OR REPLACE PROCEDURE insertAccount(owner IN
    varchar, bal IN number, newid OUT number)
    AS LANGUAGE JAVA NAME 'GenPK.insertAccount(
    java.lang.String [])';
    Invoke the stored procedure within ejbCreate().
    Public AccountPK ejbCreate(String ownerName, int balance) throws CreateException
    try {
    CallableStatement call = conn.prepareCall{
    "{call insertAccount(?, ?, ?)}"};          
    return new AccountPK(accountID);
    Custom Primary Key Finders for CMP Entity Beans
    Finder methods are used for retrieving existing EJB entity bean instances. Primary key finders allow you to retrieve a uniquely identified EJB instance. For CMP entity beans, the EJB container automatically generates the primary key finder findByPrimaryKey() method, based on declarative description. In some situations, however, you might need more control; for example, you may need a specialized finder such as findByStoredProcKey(). In these situations, you can use Java stored procedures in conjunction with an object relational framework (such as Oracle9i Application Server [Oracle9iAS] TopLink) to implement a custom primary key finder method. After you define the EJB finder as a REDIRECT or NAMED finder, TopLink will generate the SQL query for retrieving the bean instance.
    Data-Driven EJB Invocation
    In a data-driven architecture, business logic invocation can be triggered as a result of database operations (such as inserts, updates, or deletes). A Java stored procedure implementing the data logic can be declared as a database trigger to invoke EJBs running in a middle-tier J2EE application server. You can make EJB calls by using either standard remote method invocation (RMI) over Interoperable Inter-ORB Protocol (IIOP), using a J2EE 1.3 compatible server, or RMI over a vendor-specific transport protocol (such as ORMI with Oracle9iAS/OC4J or RMI over T3 with BEA WebLogic). Each application server vendor has its own optimized protocol while providing RMI over IIOP for interoperability. Oracle9iAS supports both RMI calls over IIOP and ORMI protocols.
    Data-Driven Messaging
    Oracle9i Database embeds Advanced Queuing (AQ), which is an integrated, persistent, reliable, secure, scalable, and transactional message-queuing framework. Oracle exposes AQ features to Java developers through the standard Java Messaging System (JMS) API. Java stored procedures can invoke AQ operations through the JMS interface to allow fast, intra-session, scalable, data-driven messaging.
    Java stored procedures can use JMS to invoke AQ operations. You can implement this pattern in four steps:
    Create and start the JMS Queue (to do so, embed the following operations within a SQL script):
    execute dbms_aqadm.create_queue_table(queue_table =>
    'queue1', queue_payload_type =>
    'SYS.AQ$_JMS_TEXT_MESSAGE', comment => 'a test queue',
    multiple_consumers => false, compatible => '8.1.0');
    execute dbms_aqadm.create_queue( queue_name => 'queue1',
    queue_table => 'queue1' );
    execute dbms_aqadm.start_queue(queue_name => 'queue1');
    Create the Java stored procedure (a code snippet is shown):
    public static void runTest(String msgBody)
    try
    // get database connection
    ora_drv = new OracleDriver();
    db_conn = ora_drv.defaultConnection();
    // setup sender (cf online code sample)
    // create message
    s_msg = s_session.createTextMessage(msgBody);
    // send message
    sender.send(s_msg);
    s_session.commit();
    // receive message
    r_msg = (TextMessage) receiver.receive();
    r_session.commit();
    // output message text
    String body = r_msg.getText();
    System.out.println("message was '"+body+"'");
    Create the Call Spec:
    create or replace procedure jmsproc (t1 IN VARCHAR)
    as language java name 'jmsSample.main (java.lang.String[])';
    Invoke the stored procedure:
    call jmsproc('hello');
    Database-Assisted Web Publishing (Cache Invalidation)
    One of the common issues application architects must face is how to cache database information reliably to increase overall system performance. JCACHE is an upcoming standard specification (JSR 107) that addresses this problem. It specifies an approach for temporary, in-memory caching of Java objects, including object creation, shared access, spooling, invalidation, and consistency across JVMs. It can be used to cache read-mostly data such as product catalogs and price lists within JSP. Using JCACHE, most queries will have response times an order of magnitude faster because of cached data (in-house testing showed response times about 15 times faster).
    In order to track all the changes to the origin data and refresh the cached data, a Java stored procedure is attached to a table as a trigger. Any change to this table will result in the automatic invocation of this stored procedure, which in turn will call out a defined JSP to invalidate the JCACHE object that maps its state to the database table. Upon invalidation, the very next query will force the cache to be refreshed from the database. Next Steps
    READ MORE about Java Stored Procedures
    This article is adapted from the white paper "Unleash the Power of Java Stored Procedures." You can find the white paper at:
    /tech/java/java_db/pdf/
    OW_30820_JAVA_STORED_PROC_paper.PDF
    New PL/SQL features in Oracle9i Database, Release 2
    /tech/pl_sql/pdf/
    Paper_30720_Doc.pdf
    Resolver Spec
    /docs/products/oracle9i/
    doc_library/release2/java.920/a96659.pdf
    OracleJVM and Java 2 Security
    /docs/products/oracle9i/
    doc_library/release2/java.920/a96656.pdf
    DOWNLOAD Code
    Exercise code examples from this article:
    /sample_code/tech/
    java/jsp/Oracle9iJSPSamples.html
    LEARN about stored procedures as Web services
    /tech/webservices
    Extending Database Functionality
    One of the great things about running Java code directly in the database is the ability to implement new functionality by simply loading the code or library and using the Call Spec to make the entry points (public static methods) available to SQL, PL/SQL, Java, J2EE, and non-Java APIs. Oracle9i Database customers can easily extend database functionality. Oracle itself leverages this capability for new utilities and packages such as the XML Developer Kits (XDKs).
    Bridging SQL, PL/SQL, Java, J2EE, .NET, and XML
    The Oracle XDK is written in Java and exposes its public methods as Java stored procedures, extending the database's XML programmability. SQL, PL/SQL, Java, J2EE, and non-Java (.NET) business logic all have access to the XML parser, the XSLT processor, the XPath engine, and XML SQL Utility (XSU).
    The XML parser is accessible through the xmlparser and xmldom packages. XSU is a Java utility that generates an XML document from SQL queries or a JDBC ResultSet, and writes data from an XML document into a database table or view. Using XSU, XML output can be produced as Text, DOM trees, or DTDs. XSU is exposed to PL/SQL through the dbms_xmlquery and dbms_xmlsave packages.
    Conclusion
    The integration of the Oracle database with a Java VM enables the creation of portable, powerful, database-independent data logic and persistence logic. The loose coupling of business logic that runs in the middle tier with data logic that runs in the database tier improves application scalability, performance, flexibility, and maintenance.
    Kuassi Mensah ([email protected]) is a product manager in the Server Technologies division at Oracle.
    http://otn.oracle.com/oramag/oracle/03-jan/o13java.html
    Joel Pérez

  • Message Selector and Setting JMS Header Properties PL/SQL Enqueue

    Currently I am attempting to use the Message selector functionality. I just know know exactly how we need to set the property in PL/SQL when enqueuing. I also want to verify the syntax that I should use in the event that I am doing this incorrectly...
    The code I am using to test the enqueue is
    declare
    enqueue_options dbms_aq.enqueue_options_t;
    message_properties dbms_aq.message_properties_t;
    message_handle RAW(16);
    agent sys.aq$_agent := sys.aq$_agent('', null, null);
    message sys.aq$_jms_text_message;
    recipients DBMS_AQ.aq$_recipient_list_t;
    BEGIN
    message := sys.aq$_jms_text_message.construct;
    message.set_text('<ORDER><HEADER_ID>16992531</HEADER_ID></ORDER>');
    message.header.set_string_property('bamfilter','ORDER_ENTRY');
    dbms_aq.enqueue(queue_name => 'XX_OM_MONITOR_Q',
    enqueue_options => enqueue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle);
    COMMIT;
    END;
    we have tried a few other methods, but still to no avail...
    the syntax I believe for the selector in the ems should be bamfilter='ORDER_ENTRY'
    Any help would be great.
    The DB the Queue is locate is on 10g if that makes any difference...

    Yes
    I am able to specify JMS Header and JMS Properties when producing a message. However I am not able to user "Message Selector" to filter messages based on JMS Properties information when consuming messages.
    In the link you provide, there is an example on how to use Message Selector:
    # (a copy from the link)
    Message Selector
    ...for example, you can enter logic, such as:
    * JMSType = 'car' AND color = 'blue' AND weight > 2500
    * Country in ('UK', 'US', 'France')
    I believe the example with "Country" is exactly what I need, but I can´t get it work.
    I create the same example above, setting a property named "Country" in the JMSHeader, sending the message to a JMS Queue (BPEL Process #1) and try to comsume it on the Message Selector (BPEL Process#2), but JMSAdapter never consumes the message.
    Thanks for your help.

  • JMS Text Msg Payload - Oracle 8i

    I am using Oracle8i Enterprise Edition Release 8.1.7.4.0 for creating a queue uisng Oracle AQ with payload type
    SYS.AQ$_JMS_TEXT_MESSAGE. When I tried create a queue, I found some of components in SYS.AQ$_JMS_TEXT_MESSAGE are missing in Oracle 8i. Without those components usage, the message cannot set as payload in the queue. The explanation is as below.
    My script for creation of queue is as follows..
    CREATE OR REPLACE PROCEDURE NCR_ESB_NOL_SCRIPT(order_clob_load in CLOB)
    IS
    qtable_present number;
    queue_present number;
    enqopt dbms_aq.enqueue_options_t;
    msgprop dbms_aq.message_properties_t;
    enq_msgid raw(10000);
    order_headers_clob clob;
    msgsize number(38);
    message sys.aq$_jms_text_message;
    clob_msg_queuetable varchar2(100);
    clob_msg_queue varchar2(100);
    BEGIN
    -- Queue table and queue
    clob_msg_queuetable := 'TEST_QTAB';
    clob_msg_queue := 'TEST_Q';
    order_headers_clob := order_clob_load;
    --create queue table
    select count(*) into qtable_present from user_tables where table_name = 'TEST_QTAB';
         if (qtable_present <> 1)
         then
              dbms_aqadm.create_queue_table(queue_table => clob_msg_queuetable,
                                            multiple_consumers => TRUE,
                                       queue_payload_type => 'SYS.AQ$_JMS_TEXT_MESSAGE',
                                       compatible => '8.1');
         end if;
    --create queue 
    select count(*) into queue_present from user_queues where name = 'TEST_Q';
         if (queue_present <> 1)
         then
              dbms_aqadm.create_queue(queue_name=>clob_msg_queue,
    queue_table => clob_msg_queuetable,
    retention_time => 86400);
    dbms_aqadm.add_subscriber(clob_msg_queue, SYS.AQ$_AGENT ('OA', NULL, NULL));
         end if;
    dbms_aqadm.start_queue(clob_msg_queue);
    message := sys.aq$_jms_text_message.construct;
    message.setText(order_headers_clob);
    dbms_aq.enqueue(
    queue_name => clob_msg_queue, -- IN
    enqueue_options => enqopt, -- IN
    message_properties => msgprop, -- IN
    payload => message, -- IN
    msgid => enq_msgid); -- OUT
    COMMIT;
    When I tried the above script, I got error as follows.
    PL/SQL: Statement ignored
    PLS-00302: component 'CONSTRUCT' must be declared
    PL/SQL: Statement ignored
    PLS-00302: component 'SETTEXT' must be declared
    When I tried DESC SYS.AQ$_JMS_TEXT_MESSAGE , it shows as :
    SQL> DESC SYS.AQ$_JMS_TEXT_MESSAGE
    Name Null? Type
    HEADER AQ$_JMS_HEADER
    TEXT_LEN NUMBER(38)
    TEXT_VC VARCHAR2(4000)
    TEXT_LOB CLOB
    It does not show the components CONSTRUCT and SET_TEXT. Also I will be in need of GET_TEXT component also to dequeue the queue data and test it. I would like to know whether the components CONSTRUCT and SET_TEXT are availble in Oracle 8i or not. Without those components, is there any other way to set payload in the queue?
    Help in this regard from any body who knows about this is really appreciated.
    Thanks

    Hi, not sure where you have sorted this out yet, but I ended up creating my own wrappers. Hope these are of use:
    FUNCTION new_properties
    RETURN SYS.AQ$_JMS_USERPROPARRAY
    IS
    l_prop_arr SYS.AQ$_JMS_USERPROPARRAY;
    BEGIN
    l_prop_arr := SYS.AQ$_JMS_USERPROPARRAY();
    RETURN l_prop_arr;
    END new_properties;
    FUNCTION new_agent
    RETURN SYS.AQ$_AGENT
    IS
    c_name CONSTANT VARCHAR2(30) := NULL;
    c_address CONSTANT VARCHAR2(100) := NULL;
    c_protocol CONSTANT NUMBER := 0;
    l_agent SYS.AQ$_AGENT;
    BEGIN
    l_agent := SYS.AQ$_AGENT(c_name, c_address, c_protocol);
    RETURN l_agent;
    END new_agent;
    FUNCTION new_header
    RETURN SYS.AQ$_JMS_HEADER
    IS
    c_type CONSTANT VARCHAR2(100) := NULL;
    c_jms_userid CONSTANT VARCHAR2(100) := 'waveq';
    c_appid CONSTANT VARCHAR2(100) := NULL;
    c_groupid CONSTANT VARCHAR2(100) := NULL;
    c_groupseq CONSTANT INTEGER := 1;
    l_replyto SYS.AQ$_AGENT;
    l_proparr SYS.AQ$_JMS_USERPROPARRAY;
    l_jms_header SYS.AQ$_JMS_HEADER;
    BEGIN
    l_replyto := new_agent();
    l_proparr := new_properties();
    l_jms_header := SYS.AQ$_JMS_HEADER(l_replyto, c_type, c_jms_userid, c_appid, c_groupid, c_groupseq, l_proparr);
    RETURN l_jms_header;
    END new_header;
    FUNCTION new_payload(
    io_message IN OUT NOCOPY VARCHAR2)
    RETURN SYS.AQ$_JMS_TEXT_MESSAGE
    IS
    c_text_len CONSTANT INTEGER := 0;
    c_text_vc CONSTANT VARCHAR2(4000) := NULL;
    c_text_lob CONSTANT CLOB := EMPTY_CLOB();
    l_header SYS.AQ$_JMS_HEADER;
    l_jms_message SYS.AQ$_JMS_TEXT_MESSAGE;
    BEGIN
    l_header := new_header();
    l_jms_message := SYS.AQ$_JMS_TEXT_MESSAGE(l_header, c_text_len, c_text_vc, c_text_lob);
    l_jms_message.text_vc := io_message;
    l_jms_message.text_len := LENGTH(io_message);
    RETURN l_jms_message;
    END new_payload;

Maybe you are looking for