Currently, user defined types are not supported with cx_Oracle. You have
to use scalar types and anonymous PL/SQL blocks or call procedures and
functions to do the work. I do intend to do something about supporting
user defined types but it will be some time before I will have anything
useful -- I'm way too busy right now with my own work to deal with
things that I don't actually use myself. :-(
Fabio Zadrozny wrote:
> Hi,
>
> I would like to define some types on Oracle and use them.
>
> e.g.
>
> CREATE TYPE POINT AS OBJECT(
> X NUMBER,
> Y NUMBER);
>
> CREATE TYPE POLYGON AS VARRAY(1000) OF POINT;
>
> CREATE TABLE POLYGONS
> ( NAME LONG,
> POLY POLYGON);
>
> I can insert values using:
>
> insert into polygons values ('p1' , polygon(point(2,2),point(3,3))) ;
>
> But when I try to fetch them using:
>
> cursor.execute("SELECT name, poly FROM polygons ")
>
> I get the following error:
>
> Traceback (most recent call last):
> File "x:\sid15\source\sid\db\tests\test_oracle_conn.py", line 69, in
> testIt
> cursor.execute("SELECT name, poly FROM polygon ")
> NotSupportedError: Variable_TypeByOracleDataType: unhandled data type 108
>
> Dows anyone know how can I make it work?
>
> []s
>
> Fabio
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> _______________________________________________
> cx-oracle-users mailing list
> cx-...@li...
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
--
Anthony Tuininga
an...@co...
Computronix
Distinctive Software. Real People.
Suite 200, 10216 - 124 Street NW
Edmonton, AB, Canada T5N 4A3
Phone: (780) 454-3700
Fax: (780) 454-3838
http://www.computronix.com
|