Hi,
Currently the only way to return Oracle objects is via select
statements. There is no mechanism to define the output area which is
what is needed to be able to populate OUT objects from PL/SQL. Its on
my list of things to do -- but my list is very long and since I don't
have any current need for it myself it tends to settle towards the
bottom of the pile, unfortunately. That said, its the top priority
major item in my opinion. I have always been interested in advanced
queuing myself and this question has come up many times over the past
years. Short answer: not anytime in the next couple of months but I
should have more time available in the summer anyway -- crossing
fingers and toes! :-)
Anthony
On Thu, Feb 4, 2010 at 4:31 AM, Pablo Stapff <pab...@gm...> wrote:
> Hi again,
>
> I saw a similar question from 2005, so I would like to know if
> something changed in the meantime:
>
> We want to use python with Oracle Advanced Queuing, and I would like
> to know if it possible (and how) to return oracle objects in python
> bind variables. I saw tests returning objects from selects but nothing
> from PL/SQL blocks.
>
> In the following example the message is returned using each attribute,
> and I would like to return the whole message as an object
>
> The message definition:
>
> CREATE TYPE message_resp_typ AS object(
> success NUMBER,
> stdout BLOB,
> stderr BLOB,
> attachment BLOB
> )
> /
>
> the python code:
>
> c = db.cursor()
> l_success = c.var(cx_Oracle.NUMBER)
> l_stdout = c.var(cx_Oracle.BLOB)
> l_stderr = c.var(cx_Oracle.BLOB)
> l_attachment = c.var(cx_Oracle.BLOB)
> c.execute('''
> DECLARE
> dequeue_options DBMS_AQ.dequeue_options_t;
> message_properties DBMS_AQ.message_properties_t;
> message_handle RAW(16);
> message message_resp_typ;
> BEGIN
> dequeue_options.navigation := DBMS_AQ.FIRST_MESSAGE;
> dequeue_options.correlation := :v_correlation;
> DBMS_AQ.DEQUEUE(
> queue_name => :v_queue,
> dequeue_options => dequeue_options,
> message_properties => message_properties,
> payload => message,
> msgid => message_handle);
> :v_success := message.success;
> :v_stdout := message.stdout;
> :v_stderr := message.stderr;
> :v_attachment := message.attachment;
> END;''',
> v_queue = queue,
> v_correlation = id,
> v_success = l_success,
> v_stdout = l_stdout,
> v_stderr = l_stderr,
> v_attachment = l_attachment
> )
>
> Can please someone give me some advice or an example?
>
> Thanks in advance
> Pablo
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> cx-oracle-users mailing list
> cx-...@li...
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>
|