[Zope] Constructing a DCOracle2 BindingArray to match an OUT parameter

Matthew T. Kromer matt@zope.com
Mon, 14 Oct 2002 10:35:54 -0400


John Ziniti wrote:

> Hopefully this is not OT for this list.  I am having trouble
> understanding how to construct a BindingArray object
> to match and OUT param being used in one of my stored
> procedures.  The OUT is defined in the PACKAGE as:
>
> TYPE result_rec is RECORD (
>    sample_id   wells.sample_id_dn%TYPE,
>    ... etc ...
> );
>
> TYPE result_table IS TABLE OF result_rec
>  index by BINARY_INTEGER;
>
> PROCEDURE get_qc_report
> (
>   result_tab_io       IN OUT result_table,
>   ... etc ...
> )
>
> If I try to pass in (just guessing), for example:
>
> results = cnx.BindingArray(1, 9, 'SQLT_REF')
>
> All I get is an "ORA-00000"
>
> results = cnx.BindingArray(1, 9, 'SQLT_RSET')
>
> segfaults and brings down my Zope ...
>
> I'm not sure what kind of BindingArray I should be
> using.
>

Generally the code will try to make Binding Arrays for you -- however, 
it doesn't handle (I dont think) multi-column table form.

It does handle simple single-column result tables, in which case the 
type of the binding array (if you use it manually) is your column type.

The code *does* handle return of cursors properly -- so if you can 
arrange to return a cursor into your table that will work fine.

Matt Kromer
Zope Corporation  http://www.zope.com/