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
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
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
Thank you very much but I'd need more clarifications. Arpad Kiss wrote:
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.
The size of the msg passed to Raise_application_error are limited, so it cannot be used as a real data returning (if this was your intention in this example) mechanism.
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,
Not bad, I like the idea! Still, there is another problem: what about OUT (or IN/OUT) parameters? Here is a more simple example: """begin dbms_output.enable; dbms_output.put_line('Kiss'); dbms_output.put_line('Arpad'); dbms_output.get_lines(:lines,:numlines); end;""" I know that there is a dbms_output.get_line, but let us suppose that you have only get_lines. Shall I create wrapper PL/SQL procedures around procedures returning arrays? Do you have any idea how to circumvent this problem? NM
On Sat, 6 Nov 1999, N�meth Mikl�s wrote:
I am evaluating Zope, and I would like to know if there is a Zope database driver for Oracle?
Yes - ZOracleDA is available on zope.org
Is there a documentation about the services of this driver?
It uses DCOracle (the DC standing for Digital Creations, who also wrote Zope and ZOracleDA). I gather from your email to the python DB-SIG list that you have already looked into this interface, so this should alswer the rest of your questions. Note that ZOracleDA doesn't really give you any services, or access to DCOracle or Oracle direct - it is mearly an adaptor for the ZSQL interface so you should go over the ZSQL guide available at http://www.zope.org/Documentation/Guides ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen
participants (3)
-
Arpad Kiss -
N�meth Mikl�s -
Stuart 'Zen' Bishop