[Zope-DB] DCOracle2 problem on Solaris 8

tenasakai@earthlink.net tenasakai@earthlink.net
Wed, 17 Jul 2002 11:30:07 -0700


Matt,

Thank you!
You hit the nail on its head.  The code below works.

	#!/usr/local/bin/python

	import DCOracle2
	db = DCOracle2.connect('scott/tiger@glbl')
	c = db.cursor()
	c.execute("select * from scott.emp")
	print c.fetchall()

About a week or so ago, I had tried the import with DCOracle2
and it complained as to it couldn't find DCOracle2.  I used find
command in all lib directories for DCOracle2* and didn't find it.
Then I tried with dco2 and that didn't complain.  But dco2.connect()
didn't like 'scott/tiger@glbl' and it told me that it wanted 3 arguments.
I gave what it asked, ie., "'scott', 'tiger', 'glbl'" and it stopped complain-

ing.  And invocation of db.cursor() was done silently as well.  All this
let me look over DCOracle2.

Anyhow, your help is much appreciated.  I feel I am out of woods
(famous last word?).

Regards,

Tena Sakai


	"Matthew T. Kromer" <matt@ZOPE.COM>
	Sent by: zope-db-admin@zope.org
	07/17/2002 10:55 AM
		 
		 To: tenasakai@earthlink.net
		 cc: Antonio Orlando <aorlando2002@yahoo.com.br>, zope-db@zope.org
		 Subject: Re: [Zope-DB] DCOracle2 problem on Solaris 8


tenasakai@earthlink.net wrote:

>Antonio Orlando wrote:
>
> > Does the user 'report' have 'select' permission on the 'scott' schema?
> > just another point of view... this code runs fine in my db...(runned in
> > python 1.5, thought...)
>
>I am encouraged by your statement, but I am sticking to my gun.
>
>Let me state version numbers one more time:
> Python          2.1.3
> Zope            2.5.1
> DCOracle2       1.1
> machine:        Sparc SunFire4800, Solaris 8 (SunOS 5.8), vixen
>You say your Python is 1.5?  What about Zope and DCOracle2?
>Are you running Python on Sun or Windows?
>
>Here's a concise version to illustrate my point.  My comments
>are with ## at the beginning of the line and what I typed to the
>computer and what the computer returned are indented.
>
>Script started on Wed Jul 17 09:54:35 2002
>
>##First, let's set the baseline.
>
>vixen: ~, 1
>vixen: ~, 1 sqlplus scott/tiger@glbl
>
>SQL*Plus: Release 8.1.6.0.0 - Production on Wed Jul 17 09:54:51 2002
>
>(c) Copyright 1999 Oracle Corporation.  All rights reserved.
>
>
>Connected to:
>Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
>With the Partitioning option
>JServer Release 8.1.7.0.0 - Production
>
>SQL>
>SQL> select * from scott.emp;
>
>     EMPNO ENAME      JOB        MGR HIREDATE     SAL       COMM
>---------- ---------- --------- ---------- --------- ---------- ----------
>    DEPTNO
>----------
>      7369 SMITH      CLERK       7902 17-DEC-80     800
> 20
>
>      7499 ALLEN      SALESMAN       7698 20-FEB-81    1600        300
> 30
>
>      7521 WARD       SALESMAN       7698 22-FEB-81    1250        500
> 30
>
>##    ...more output lines...
>##    ....which I deleted....
>
>14 rows selected.
>
>SQL>
>SQL> exit
>Disconnected from Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
>With the Partitioning option
>JServer Release 8.1.7.0.0 - Production
>
>##Ok, that is good enough.  Let's see if I can do the same from Python.
>
>vixen: ~, 2
>vixen: ~, 2 python -V
>Python 2.1.3
>
>##It is the correct version as suggested by Fabiano.
>##Let's run it.
>
>vixen: ~, 3
>vixen: ~, 3 python
>Python 2.1.3 (#1, Jul 16 2002, 13:17:06)
>[GCC 3.0.3] on sunos5
>Type "copyright", "credits" or "license" for more information.
>
>
>>>>import dco2
>>>>
>>>>
>>>>

Erm

I just noticed

You're trying to use the C module alone

Dont

Instead, use DCOracle2

It wraps the C module for you

 >>> import DCOracle2
 >>> db = DCOracle2.connect('scott/tiger@glbl')

If you still get "an integer is required..."  then  setenv
DCO2TRACELOG=dco2.tracelog

try again

send me the trace

*nothing* in the connect wants an integer, so I suspect something is
FUNKY in your environment.

(Funky writing style courtesy of the music I'm listening to)

If you try to use the C interface natively, you have to code
differently.  You can get faster results, but it isn't DB API compatible.

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





_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://lists.zope.org/mailman/listinfo/zope-db