[Zope] Oracle access from Zope

Arpad Kiss sekter@mail.matav.hu
Tue, 9 Nov 1999 00:57:51 +0100


Hi,
Today I have time playing around with DCOracle and it seems to me the
array-argumented PL/SQL procedures are not supported(as you have written).
But I can call a procedure that has a PL/SQL table argument. Here is my
silly sample:
First I created a package:

create PACKAGE TestPackage as
    TYPE tt_type IS TABLE OF LONG INDEX BY BINARY_INTEGER;
    procedure join( par tt_type, ub BINARY_INTEGER);
end TestPackage;

create PACKAGE body TestPackage as
    procedure join( par tt_type, ub BINARY_INTEGER) is
         msg LONG;
         i BINARY_INTEGER;
    begin
          msg:='';
          for i in 1..ub loop
            msg:=msg||par(i);
          end loop;
          Raise_application_error (-20053, msg);
    end;
end TestPackage;

As you can see this join procedure raises an application error with the
joined elements of the array.

In Zope I just create a SQL Method with this query template(in Python I
simple call the execute method of a cursor with this):

begin
    declare
        b TestPackage.tt_type;
        n BINARY_INTEGER:=3;
    begin
        b(1):='alma:';
        b(2):='b';
        b(3):='c';
        TestPackage.join(b,n);
     end;
end;

It is not too elegant, but maybe it helps you,
Arpad



----- Original Message -----
From: Arpad Kiss <sekter@mail.matav.hu>
To: Németh Miklós <nemeth@iqsoft.hu>; zope <zope@zope.org>
Sent: Saturday, November 06, 1999 6:39 PM
Subject: Re: [Zope] Oracle access from Zope


> You can download the ZOracleDA product from zope.org.
> I don't know if array-argumented PL/SQl procedures are suported or not.
I've
> never tried it.
> There is an ODBC Zope product, but I am not familiar with it.
> From Python you can access Oracle through ODBC, RDO etc. too. These can be
> used in external methods, or the COM objects may be accessible through the
> COM Zope product.
> Arpad Kiss
>
> ----- Original Message -----
> From: Németh Miklós <nemeth@iqsoft.hu>
> To: zope <zope@zope.org>
> Sent: Saturday, November 06, 1999 11:40 AM
> Subject: [Zope] Oracle access from Zope
>
>
> > I am evaluating Zope, and I would like to know if there is a Zope
> > database driver for Oracle?
> > Is there a documentation about the services of this driver?
> > Recently, I have been evaluating several Oracle database access
> > interface modules for Perl, Tcl, Python, and found an interesting thing:
> >
> > none of these modules support calling PL/SQL procedures having array
> > arguments (I do not speak of records or array of records because even
> > OCI does not support record arguments). What about the Zope - Oracle
> > module?
> > It is very important in our case, because in our application
> > array-argumented PL/SQL procedures are heavily used for efficiency
> > reasons (they are really quite fast).
> >
> > Miklos Nemeth
> > IQSOFT
> >