Passing payload to job triggered by an advance queue

I created an event that suscribe to a queue:
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'testJob'
program_name => 'myTestProgram'
,enabled => TRUE
,start_date => SYSTIMESTAMP
,queue_spec => 'JOB_MSG_QUEUE,JOB_RECIPIENT'
,event_condition => 'tab.user_data.type = ''test'''
When I enqueue messages, the job is triggered as expected.
What I need to do is to pass the message payload to the program. In the event condition, I can access that payload using tab.user_data. Is there a way to pass this payload to the program?
I thought about using PLSQL_BLOCK instead of a program, but it doesn't help either.
Is this the right approach?

Hi!
No you only save and after define the step!
If you click Immediate, your job start immediatelly and not after event.
Max

Similar Messages

  • FM which determines which job triggered the program

    Hi all,
    I have a programmed triggerred by several jobs.
    when the program is trigerred i want to know which job triggerred the program because i have different conditions for different jobs.
    Is there any FM which determines which job triggered the program
    Thanks

    Hi,
    I passed the dialog type as N for BP_FIND_JOBS_WITH_PROGRAM
    What does N means.
    Also the above FM brings the entries from  TBTCP.
    Iam not sure whether TBTCP gets an entry after the job is completed or once the job is created in SM36.
    Let me know
    Thanks

  • From Database pass in Provisioning job

    Hello SDN,
    I'm trying in a provisioning job to get some data from the database and then sending it back onto the database, here i found the 'from database' pass satisfying.
    The problem is i'm getting this wired error: "Fromsource ODBC is a illegal type for provisioning!" when i have set it all up and trys to run it.
    I have been reading in the help files and found that ODBC only is used when the runtime engine is Windows but mine is running on a Java runtime engine. the link i uses for the connection is the global constant %$ddm.identitycenter% and i uses it several places outside the provisioning jobs in 'from database' pass.
    I have then been reading further in the help files and found this quote: 'A task always operates on one given entry in the identity store. This is why there is no source defined in the pass of the job in an action task.' is this why i can't connect up to the database?
    Some one having any idea?
    Best Regards
    Jesper Lindstrøm Nielsen

    Jesper,
    You can not use FromPass into Provisioning Job.
    To do so, Create an Administration Job with to pass :
    1- FromDatabase (....) to read date from your source
    2- ToDatabase (....) to send it back with needed transformation
    This job can be run manualy (using runnow) or scheduled, but can as well be call from a provisioning job. To do so;
    Create a Provision Job with ToGeneric pass,
    Into the ToGeneric pass, write a javascript function with :
    OutString = uRunJobNow(<Job ID of the administration job previously defined>)
    Benjamin

  • What are the selections when defining a job triggered by an event?

    I use SM36 by defining a job triggered by an event. I click "Start conditions" button, then click "After event" button and place the event name.  I wonder if I would have to continue to click the button "Immediate" button and save it?  or just save it without clicking the "Immediate" button?
    Thanks and this question is urgent!

    Hi!
    No you only save and after define the step!
    If you click Immediate, your job start immediatelly and not after event.
    Max

  • Advanced Queuing between 2 databases

    Hi,
    We want to use Oracle Advance Queuing to send a message from a source Database (transactional) to a Reporting database
    On a particular event on a record in the source database, we want to enqueue the record's code on a Queue in the target database, where the dequeuing will happen and some processing will take place for each code retrieved.
    Do we need to set up the Advanced Queuing software on both DBs?
    - Can we just have 1 queue on the target DB and get the source Database to enqueue records to it? How will the source DB will be given access to the queue?
    - Or do I really need to have a queue on each Database and use propagation?
    Thanks in advance for your help.
    Rgds

    Tony,
    thanks very much for your precious advice.
    I like your suggestion of having one queue, it keeps the infrastruture simple.
    Have I got the option of having this single queue either at the source or the target DB?
    Maybe let me summarise more precisely what I am trying to achieve: we want to copy a complex data structure on the Source DB to a simplified/flatter data structure on the reporting DB.
    An event on a row on the main table on the source DB triggers the copy.
    We are thinking of enqueing of the record's id to the queue (So app on the source DB will have to enqueue)
    and when dequeuing each message , a stored procedure will read the data structure for this record id and child tables and insert the relevant data to the report data structure on the target DB.
    So with one queue, it seems that there are 3 options, not sure which is best. The idea is to have minimum impact on the source DB
    1. Queue at the target DB. Source DB enqueues message remotely (is this possible? can't find any documentation about this?). Message is dequeued at the target and the proc (at target) reads from the source with DB link and writes the new data to the target
    2. Queue at the source DB. Source DB enqueues message locally, an application on the target DB dequeues the message and the procedure (at target) reads from the source with DB link and writes the new data to the target DB.
    3.Queue at the source DB. Source DB enqueues message locally, an application on the source DB dequeues the message and the procedure (at source) reads data from the source and writes the new data to the target using a DB link
    3. seems having the most impact on performance of the source db?
    In all case I don't think I can avoid a DB link in the sored proc (one way or the other) as the data structures are a too complex to be passed through the queue....
    What do you think?
    Thanks
    Philippe

  • Does the advanced queue support setting the pay load type as array/table?

    Does the advanced queue support setting the pay load type as array/table?
    if yes, how to write the enqueue script, I tried to write the following the script to enqueue, but failed, pls help to review it . Thanks...
    ------Create payload type
    create or replace TYPE "SIMPLEARRAY" AS VARRAY(99) OF VARCHAR(20);
    ------Create queue table
    BEGIN DBMS_AQADM.CREATE_QUEUE_TABLE(
    Queue_table => 'LUWEIQIN.SIMPLEQUEUE',
    Queue_payload_type => 'LUWEIQIN.SIMPLEARRAY',
    storage_clause => 'PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 TABLESPACE USERS',
    Sort_list => 'ENQ_TIME',
    Compatible => '8.1.3');
    END;
    ------Create queue
    BEGIN DBMS_AQADM.CREATE_QUEUE(
    Queue_name => 'LUWEIQIN.SIMPLEQUEUE',
    Queue_table => 'LUWEIQIN.SIMPLEQUEUE',
    Queue_type => 0,
    Max_retries => 5,
    Retry_delay => 0,
    dependency_tracking => FALSE);
    END;
    -------Start queue
    BEGIN
    dbms_aqadm.start_queue(queue_name => 'LUWEIQIN.SIMPLEQUEUE', dequeue => TRUE, enqueue => TRUE);
    END;
    -------Enqueue
    DECLARE
    v_enqueueoptions dbms_aq.enqueue_options_t;
    v_messageproperties dbms_aq.message_properties_t;
    p_queue_name VARCHAR2(40);
    Priority INTEGER;
    Delay INTEGER;
    Expiration INTEGER;
    Correlation VARCHAR2(100);
    Recipientlist dbms_aq.aq$_recipient_list_t;
    Exceptionqueue VARCHAR2(100);
    p_queue_name VARCHAR2(40);
    p_msg VARCHAR2(40);
    p_payload LUWEIQIN.SIMPLEARRAY;
    BEGIN
    p_payload(1) := 'aa';
    p_payload(2) := 'bb';
    SYS.DBMS_AQ.ENQUEUE(queue_name => 'LUWEIQIN.SIMPLEQUEUE',enqueue_options => v_enqueueoptions, message_properties => v_messageproperties, msgid => p_msg, payload => p_payload);
    END;
    ------Get error
    Error starting at line 1 in command:
    DECLARE
    v_enqueueoptions dbms_aq.enqueue_options_t;
    v_messageproperties dbms_aq.message_properties_t;
    p_queue_name VARCHAR2(40);
    Priority INTEGER;
    Delay INTEGER;
    Expiration INTEGER;
    Correlation VARCHAR2(100);
    Recipientlist dbms_aq.aq$_recipient_list_t;
    Exceptionqueue VARCHAR2(100);
    p_queue_name VARCHAR2(40);
    p_msg VARCHAR2(40);
    p_payload LUWEIQIN.SIMPLEARRAY;
    BEGIN
    p_payload(1) := 'aa';
    p_payload(2) := 'bb';
    SYS.DBMS_AQ.ENQUEUE(queue_name => 'LUWEIQIN.SIMPLEQUEUE',enqueue_options => v_enqueueoptions, message_properties => v_messageproperties, msgid => p_msg, payload => p_payload);
    END;
    Error report:
    ORA-06550: line 17, column 3:
    PLS-00306: wrong number or types of arguments in call to 'ENQUEUE'
    ORA-06550: line 17, column 3:
    PL/SQL: Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause: Usually a PL/SQL compilation error.
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    but when I use the following script to enqueue get error. Pls help to review. Thanks...
    DECLARE
    v_enqueueoptions dbms_aq.enqueue_options_t;
    v_messageproperties dbms_aq.message_properties_t;
    p_queue_name VARCHAR2(40);
    Priority INTEGER;
    Delay INTEGER;
    Expiration INTEGER;
    Correlation VARCHAR2(100);
    Recipientlist dbms_aq.aq$_recipient_list_t;
    Exceptionqueue VARCHAR2(100);
    p_queue_name VARCHAR2(40);
    p_msg VARCHAR2(40);
    p_payload LUWEIQIN.SIMPLEARRAY;
    BEGIN
    p_payload(1) := 'aa';
    p_payload(2) := 'bb';
    SYS.DBMS_AQ.ENQUEUE(queue_name => 'LUWEIQIN.SIMPLEQUEUE',enqueue_options => v_enqueueoptions, message_properties => v_messageproperties, msgid => p_msg, payload => p_payload);
    END;
    ------Get error
    Error starting at line 1 in command:
    DECLARE
    v_enqueueoptions dbms_aq.enqueue_options_t;
    v_messageproperties dbms_aq.message_properties_t;
    p_queue_name VARCHAR2(40);
    Priority INTEGER;
    Delay INTEGER;
    Expiration INTEGER;
    Correlation VARCHAR2(100);
    Recipientlist dbms_aq.aq$_recipient_list_t;
    Exceptionqueue VARCHAR2(100);
    p_queue_name VARCHAR2(40);
    p_msg VARCHAR2(40);
    p_payload LUWEIQIN.SIMPLEARRAY;
    BEGIN
    p_payload(1) := 'aa';
    p_payload(2) := 'bb';
    SYS.DBMS_AQ.ENQUEUE(queue_name => 'LUWEIQIN.SIMPLEQUEUE',enqueue_options => v_enqueueoptions, message_properties => v_messageproperties, msgid => p_msg, payload => p_payload);
    END;
    Error report:
    ORA-06550: line 17, column 3:
    PLS-00306: wrong number or types of arguments in call to 'ENQUEUE'
    ORA-06550: line 17, column 3:
    PL/SQL: Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause: Usually a PL/SQL compilation error.
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Advanced Queues Snapshot too old error

    I am using the advanced queues to submit work for parallel processes running through the Oracle Job Queue.
    I have attempted running anywhere from 1 to 5 simultaneous processes (in addition the the process which submits them to the Oracle job queue and populates the advanced queues) and I am getting sporadic Snapshot too old errors when the other processes are attempting to dequeue. The Advanced queues are populated before the other processes are submitted to the job queue, so I don't see that there could be conflicts between one process enqueuing while another is dequeuing.
    The reason I am attempting this is to try and gain some performance by running processes in parallel.
    Has anyone else had problems like this? Is this a bug in Oracle 8.1.6? Is there a parameter setting I need to adjust? Are there any suggestions for getting around this problem?

    I don't know what version of the database you are running? I'm only using 8.1.7.4. But where I come from, you add datafiles to the tablespace, not the rollback segment.
    alter tablespace rollback
    add datafile '&lt;blah, blah&gt;'
    size 147m
    autoextend on next 100m maxsize 2047m;
    Make sure that you have a suitable number of rollback segments that are well-sized extents. But mostly, listen the Tom Best, and try and introduce some best practices (no pun intended) to reduce the likelihood of this situation arising.

  • Dequeue from Advanced Queue

    Hi All,
    I have used the DBMS_AQ package provided dequeue functionality for dequeuing msgs from my advanced queue. Now there is a job which dequeue the items from this queue and sends out email. Now what is happening is the job picks up an item from the advanced queue for dequeuing and sends out email, but the item which is picked up still remains in the queue and is not dequeued. As the job runs every minute and polls the queue, it again picks up the same queue item and sends the email. This process repeats for 5-6 times and then the queue message expires. My requirement is that, the job should dequeue the item from the queue and just send email once. Please can anyone suggest what could be the solution to this problem?

    10g is not a version number it is a marketing label that applies equally to 10.1.0.2 and 10.2.0.4 and a lot of versions in between.
    That said I know this demo I wrote works in all versions of 10.2:
    http://www.psoug.org/reference/aq_demo1.html
    Compare it to what you are doing.

  • Integration Oracle Advance Queue with OSB

    We are doing integration for Oracle Advance Queue with OSB.
    I created an AQ adapter in Jdev and generate the WSDL and XSD.
    I imported both WSDL and XSD in OSB Project.
    When i am configuring the business service and selecting the WSDl i am not able to select Binding and ports, is it due to any issue in WSDL?
    Please help.
    Thanks,
    Mihir Panda

    Hi again,
    I made some adjustments to your wsdl. I added the binding part and its reference to the appropriate port.
    Now I reckon, you should be able to do your thing:
    <wsdl:definitions
    name="enq"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/aq/Applicatio90/Project4/enq"
    xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/aq/Applicatio90/Project4/enq"
    xmlns:opaque="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
    xmlns:obj1="http://xmlns.oracle.com/xdb/APPS"
    xmlns:ph="http://xmlns.oracle.com/pcbpel/adapter/aq/headers/payloadheaders/"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    >
    <plt:partnerLinkType name="Enqueue_plt" >
    <plt:role name="Enqueue_role" >
    <plt:portType name="tns:Enqueue_ptt" />
    </plt:role>
    </plt:partnerLinkType>
    <wsdl:types>
    <!-- Define AQ Headers = Payload Headers -->
    <schema attributeFormDefault="qualified" elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/aq/headers/payloadheaders/"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:obj1="http://xmlns.oracle.com/xdb/APPS" >
    <import namespace="http://xmlns.oracle.com/xdb/APPS" schemaLocation="xsd/APPS_WF_EVENT_T.xsd"/>
    <complexType name="enqHeaderCType" >
    <sequence>
    <!-- payload header -->
    <element name="PayloadHeader" type="xs:string" />
    </sequence>
    </complexType>
    <element name="enqHeader" type="ph:enqHeaderCType" />
    </schema>
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
    xmlns="http://www.w3.org/2001/XMLSchema" >
    <element name="opaqueElement" type="base64Binary" />
    </schema>
    </wsdl:types>
    <wsdl:message name="Enqueue_msg">
    <wsdl:part name="opaque" element="opaque:opaqueElement"/>
    </wsdl:message>
    <wsdl:message name="Header_msg">
    <wsdl:part name="Header" element="ph:enqHeader"/>
    </wsdl:message>
    <wsdl:portType name="Enqueue_ptt">
    <wsdl:operation name="Enqueue">
    <wsdl:input message="tns:Enqueue_msg"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="Enqueue_Binding" type="tns:Enqueue_ptt">
         <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <wsdl:operation name="Enqueue">
                   <soap:operation soapAction="put_your_own_URI_here"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
              </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="EnqueueService">
         <wsdl:port name="Enqueue_ptt" binding="tns:Enqueue_Binding">
              <soap:address location="No Target Adress"/>
         </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Good luck.
    Regards,
    Ronald

  • Triggering events from event queue

    Can anyone tell me if events triggered FROM the event queue execute immediatly before returning to the place where the trigger occured (as it seems to when I follow the code in the debugger).
    for example in my code I am:
    1) capturing a tab change event so I'm on the AWT event queue.
    2) calling stopcellediting() on a table which eventually triggers a losefocus event on a control within the table.
    3) the program flow seems to go straight to the focuslost event before returning to process the rest of tab change event.
    is this behaviour reliable? or is it just a timing coincidence?
    thanks in advance.

    This behaviour is reliable.
    All the code that executes these events is performed in the same thread, so it has no means to do something in parallel.
    SwingUtilities.invokeLater method does provide an ability to postpone execution of some code but inside Swing package it is used mainly for paint related tasks (for example the painting of the focus change will most likely occur only after the rest of tab change event processing will be executed).

  • OWB 10g R2 with Advanced Queues

    All,
    We are currently using 9.2.0.2.8 and make extensive use of Advance Queues in many of our mappings (we've put a lot of effort in to get this to work "real time"). We are now looking to upgrade from 9.2.0.2.8 to 10.2.0.2 - we've upgraded the mappings ok and the queues are there ok.
    Going forward it looks like AQ has been removed as a source for new mappings in OWB 10g R2. Can anyone shed any light on this - will it be included a future patch or is there a work around?
    I've looked at the OpenWorld presentations and making OWB process data "near real time" seems to be a big new feature.
    Thanks
    Craig

    I raised a Tar on metalink for this issue, here is the reply I got:
    This is what I received from Development:
    The real-time feature was pulled from OWB 10gR2 and this also included the
    AQ import which was in 10.1, I think they must have been
    tightly coupled. The workaround involves coding; the pre-Paris solution
    basically created a temporary table where messages were staged and this
    queue table used for the map; the map had pre/post map triggers for
    initializing/finalizing the queue. To use it effectively it would be best to
    create some scripts that generate the appropriate SQL scripts for the
    supporting map queue table and also the PLSQL procedures representing the
    pre/post map triggers. Similar manual coding is applicable for using CDC
    within OWB for OWB 10gR2.
    These features are planned for a future release.
    Implementation of this work-around is something you can do or Oracle Consulting can do. Support
    cannot assist in developing a solution for this.
    ------------------------------------------------------------------------------

  • Advanced Queues

    Hi:
    I was testing AQ on Oracle Database XE, and it seems working correctly.
    In the 'Strawman Feature Factoring List' I have seen that Advanced Queuing should be comprised in the production release.
    Has anyone tested throughly this feature on XE?
    Did anyone had issues with it?
    Any feedback welcome,
    Cheers,
    Andrea

    What version?
    For 10G R2 you can Start with:
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14229/toc.htm
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14229/toc.htm
    If you are using triggers I would recommend that you create a package that submits to the queues that the triggers interface with. That way you don't litter up the trigger code with AQ specific syntax.
    If you have a more specific question please post it.

  • Queries on Advanced Queuing in Oracle Database

    Hi All,
    We are new to Advanced Queuing.
    We have a requirement wherein we need to implement Oracle AQ.
    However upon some R&D, we got the basic idea of AQ.
    But we would like to know on a broad level,
    i.     The Purpose of enabling/Using AQ
    ii.     Basic understanding on the different components of AQ like Creating Payload, Enqueue, Dequeue messages
    iii.     Some high level understanding of the API’s – Which to use when and the purpose
    iv.     Challenges faced
    v.     Possible issues and Resolutions.
    If anyone can help us with the above questions, it would be of great help.
    Regards,
    Shruti

    Michael Ferrante (Oracle) wrote:
    Enable at least level 2 tracing in the console. You should see an exchange occur every 2 seconds (2000ms). If you do not see this then your MAX_WAIT is not being read. To enable trace level 2, open the console and left click in the text area of it. Then press the number 2 on the keyboard just above the letters Q and W. Do not use the number pad, as this will not work.If enable Level 2 in JavaConsole, nothing is written there. However, when the level 3, then every 2 seconds is displayed in the console this line:
    network: Connecting http://localhost:7001/forms/lservlet;jsessionid=LvhyQ0QNg5KkJ17vnch3pQSMT6Z00B16yVr7m64npFKTKp1pBBjv!656070063 with proxy=DIRECTI changed the file formsfeb.cfg, set MaxEventWait = 5000. All restart, And a similar message is displayed every 5 seconds in the console.
    network: Connecting http://localhost:7001/forms/lservlet;jsessionid=r31zQ0TLpHxK3kjBqMBk0tvYf9hn6wn6sGpKRppTvSX1f70pv0GS!571608984 with proxy=DIRECT
    network: Connecting http://localhost:7001/ with proxy=DIRECT

  • ADVANCED QUEUE: USING JDBC CONNECTION -

    Advanced Queue using the JDBC connection gives us AN ERROR WHEN SENDING 32K QUEUES
    Is it true that RAW datatypes using the Java AQ API do indeed have a limit of 32K in 8.1.6.
    The workaround is to use the Java AQ API with Object payloads (BLOBs) to get around the problem.
    Has anyone used any other solution ?
    Thanks
    null

    There's a JDBC forum that's probably more germane to this question-- I'd suggest reposting it there.
    Justin Cave
    ODBC Development

  • Advanced Queue - using the JDBC connection

    Advanced Queue using the JDBC connection gives us AN ERROR WHEN SENDING 32K QUEUES
    Is it true that RAW datatypes using the Java AQ API do indeed have a limit of 32K in 8.1.6.
    The workaround is to use the Java AQ API with Object payloads (BLOBs) to get around the problem.
    Has anyone used any other solution ?
    Thanks
    null

    There's a JDBC forum that's probably more germane to this question-- I'd suggest reposting it there.
    Justin Cave
    ODBC Development

Maybe you are looking for