Hello! i have Oracle 8.1.6 ZOracleDA 2.2 installed with Zope 2.1.6 on a red hat linux machine. i have an oracle table with one column containing blobs. Now i have the following problems: 1. How can i retrieve data from that table in zope or in python (syntax) ? 2. How can i insert data to that table ? i need the zope syntax something like: insert into blob_table values ('<dtml-var image>') ??? or the python syntax i have written a little script: import DCOracle, sys, os, DCOracle.dbi dbc = DCOracle.Connect('mozdb_dba/mozdb_dba') cur = dbc.cursor() fn = open('test_img.jpg','rb') data = fn.read() fn.close() param = DCOracle.dbi.dbiRaw(data) cur.execute('select blobcol from blobtable') dat = cur.fetchone() cur.close() dbc.close() print dat when i try to execute it i get the following error: Traceback (innermost last): File "blobtest.py", line 12, in ? dat = cur.fetchone() File "DCOracle/ociCurs.py", line 339, in fetchone self._error() File "DCOracle/ociCurs.py", line 109, in _error raise error, (rc, oci_.OracleErrorMessage(self._c.lda, rc)) oci.error: (24813, 'ORA-24813: cannot send or receive an unsupported LOB\012') 3. Is there a way to call a stored procedure or function that actually return values ? i succeeded in retrieving one particular value out of a table but when i try a function like : select * from some_table i fail... 4. Changes.txt: Z Oracle DA Releases 2.2.0 Added a small feature that allows you to access LOBs in the Oracle database. To do this, you must have your maximum number of results set to '1'. Otherwise, it won't work. i don't know what this is referring to. where should i make this change? Ciao, Alex -------------------------------------------------------------------------- Alexander G. Schad (Programmer) beehive elektronische medien gmbh -------------------------------------------------------------------------- mailto:ags@beehive.de mailto:service@beehive.de http://www.beehive.de fon: (+49 30) 84 78 20 fax: (+49 30) 84 78 22 99
Alexander Schad wrote:
Hello!
i have Oracle 8.1.6 ZOracleDA 2.2 installed with Zope 2.1.6 on a red hat linux machine.
i have an oracle table with one column containing blobs. Now i have the following problems:
1. How can i retrieve data from that table in zope or in python (syntax) ?
2. How can i insert data to that table ? i need the zope syntax something like: insert into blob_table values ('<dtml-var image>') ??? or the python syntax
i have written a little script:
import DCOracle, sys, os, DCOracle.dbi
dbc = DCOracle.Connect('mozdb_dba/mozdb_dba') cur = dbc.cursor() fn = open('test_img.jpg','rb') data = fn.read() fn.close() param = DCOracle.dbi.dbiRaw(data) cur.execute('select blobcol from blobtable') dat = cur.fetchone() cur.close() dbc.close() print dat
when i try to execute it i get the following error:
Traceback (innermost last): File "blobtest.py", line 12, in ? dat = cur.fetchone() File "DCOracle/ociCurs.py", line 339, in fetchone self._error() File "DCOracle/ociCurs.py", line 109, in _error raise error, (rc, oci_.OracleErrorMessage(self._c.lda, rc)) oci.error: (24813, 'ORA-24813: cannot send or receive an unsupported LOB\012')
3. Is there a way to call a stored procedure or function that actually return values ? i succeeded in retrieving one particular value out of a table but when i try a function like : select * from some_table i fail...
4. Changes.txt:
Z Oracle DA Releases
2.2.0
Added a small feature that allows you to access LOBs in the Oracle database. To do this, you must have your maximum number of results set to '1'. Otherwise, it won't work.
i don't know what this is referring to. where should i make this change?
Ciao, Alex
Alex, Oracle 8i broke DCOracle's support for LOBs; DCOracle primarily uses OCI 7 (Oracle 7) calls, and Oracle 8i enforces a restriction that OCI 8 objects cannot be used in the context of an OCI 7 statement. You can use Oracle 8.0 for this, the restriction isn't enforced until Oracle 8.1.
Alex, Oracle 8i broke DCOracle's support for LOBs; DCOracle primarily uses OCI 7 (Oracle 7) calls, and Oracle 8i enforces a restriction that OCI 8 objects cannot be used in the context of an OCI 7 statement.
You can use Oracle 8.0 for this, the restriction isn't enforced until Oracle 8.1.
Hello! thank you for your answer. but does that mean that i can only use LOBS with Oracle 8.0 ? i'm confused. i need to use LOBs. if i use oracle 8.1 can i use LOBS and if yes which Databse adapter do i need? Ciao, Alex -------------------------------------------------------------------------- Alexander G. Schad (Programmer) beehive elektronische medien gmbh -------------------------------------------------------------------------- mailto:ags@beehive.de mailto:service@beehive.de http://www.beehive.de fon: (+49 30) 84 78 20 fax: (+49 30) 84 78 22 99
Alexander Schad wrote:
Alex, Oracle 8i broke DCOracle's support for LOBs; DCOracle primarily uses OCI 7 (Oracle 7) calls, and Oracle 8i enforces a restriction that OCI 8 objects cannot be used in the context of an OCI 7 statement.
You can use Oracle 8.0 for this, the restriction isn't enforced until Oracle 8.1.
Hello! thank you for your answer. but does that mean that i can only use LOBS with Oracle 8.0 ? i'm confused. i need to use LOBs. if i use oracle 8.1 can i use LOBS and if yes which Databse adapter do i need?
If your database adapter is 8.0 you can probably use LOBs, if the adapter is 8.1 you probably can't. I never mix and match adatpters vs. databases, though, so your mileage my vary. By this I mean, you could use 8.0 libraries to access an 8.1 database via SQL*NET. I *think* the error is actually being raised at the library level, not the server itself.
Is anyone working on fixing DCOracle? I'll have someone look into if no one else is, but I'd prefer to spend the energy elsewhere if it's already being addressed. (The LOB support would be nice for me as well.) "Matthew T. Kromer" wrote:
Alexander Schad wrote:
Alex, Oracle 8i broke DCOracle's support for LOBs; DCOracle primarily uses OCI 7 (Oracle 7) calls, and Oracle 8i enforces a restriction that OCI 8 objects cannot be used in the context of an OCI 7 statement.
You can use Oracle 8.0 for this, the restriction isn't enforced until Oracle 8.1.
Hello! thank you for your answer. but does that mean that i can only use LOBS with Oracle 8.0 ? i'm confused. i need to use LOBs. if i use oracle 8.1 can i use LOBS and if yes which Databse adapter do i need?
If your database adapter is 8.0 you can probably use LOBs, if the adapter is 8.1 you probably can't. I never mix and match adatpters vs. databases, though, so your mileage my vary. By this I mean, you could use 8.0 libraries to access an 8.1 database via SQL*NET. I *think* the error is actually being raised at the library level, not the server itself.
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Monty Taylor wrote:
Is anyone working on fixing DCOracle? I'll have someone look into if no one else is, but I'd prefer to spend the energy elsewhere if it's already being addressed. (The LOB support would be nice for me as well.)
I've got a partial rewrite, but the LOB support hasn't gone in yet. Most of the functionality other than LOB support has gone in. When I tested retrieving a LOB this morning I got a nice core dump in Python after the fetch completed, and I haven't figured it out quite yet.
participants (3)
-
Alexander Schad -
Matthew T. Kromer -
Monty Taylor