[Zope-DB] DCOracle2 problem on Solaris 8

tenasakai@earthlink.net tenasakai@earthlink.net
Mon, 15 Jul 2002 17:44:11 -0700


I have a problem with DCOracle2.
First preliminaries:
      OS:         Solaris 8 (SunOS5.8) on SunFire 4800
      hostname:   vixen
      Python:           2.2.1
      Zope:       2.5.0
      DCOracle2:  1.1

Here's the particulars.  My comments have ## at the start of the line
and what I typed to the shell and what it returned are indented.

## this section shows that I can do what I want to do via sqlplus from vixen.
   vixen: ~, 1
   vixen: ~, 1 unsetenv ORACLE_SID
   vixen: ~, 2
   vixen: ~, 2 setenv ORACLE_SID glbl
   vixen: ~, 3
   vixen: ~, 3 sqlplus report/glblreport@glbl

   SQL*Plus: Release 8.1.6.0.0 - Production on Mon Jul 15 17:03:22 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> select sample_id
     2    from lims_sys.sample
     3   where (sample_id > 121)
     4     and (sample_id < 130);

    SAMPLE_ID
   ----------
          122
          123
          124
          125
          126
          127
          129

   7 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

## that looked good enough
## now I want to do the same thing from my python program

   vixen: ~, 4
   vixen: ~, 4 mkdir python-test
   vixen: ~, 5
   vixen: ~, 5 cd python-test
   vixen: ~/python-test, 6
   vixen: ~/python-test, 6 cat - > t.py
   #!/usr/local/bin/python

   import dco2 as DCOracle2
   db = DCOracle2.connect('report', 'glblreport', 'glbl')
   c = db.cursor()

   ^D
   vixen: ~/python-test, 7
   vixen: ~/python-test, 7 chmod 755 t.py
   vixen: ~/python-test, 8
   vixen: ~/python-test, 8 ls -l t.py
   -rwxr-xr-x   1 tws      dr           122 Jul 15 17:07 t.py

## here's the python code, version 0

   vixen: ~/python-test, 9
   vixen: ~/python-test, 9 cat t.py
   #!/usr/local/bin/python

   import dco2 as DCOracle2
   db = DCOracle2.connect('report', 'glblreport', 'glbl')
   c = db.cursor()

   vixen: ~/python-test, 10
   vixen: ~/python-test, 10 t.py

## no complaint, which is a good news.  now I am going to add one extra line

   vixen: ~/python-test, 11
   vixen: ~/python-test, 11 cat - >> t.py

   c.execute ('select sample_id from lims_sys.sample where (sample_id > 121)
and
(sample_id < 130)')
   ^D
   vixen: ~/python-test, 12
   vixen: ~/python-test, 12 cat t.py
   #!/usr/local/bin/python

   import dco2 as DCOracle2
   db = DCOracle2.connect('report', 'glblreport', 'glbl')
   c = db.cursor()


   c.execute ('select sample_id from lims_sys.sample where (sample_id > 121)
and
(sample_id < 130)')

## let's run it!

   vixen: ~/python-test, 13
   vixen: ~/python-test, 13 t.py
   Traceback (most recent call last):
     File "t.py", line 8, in ?
       c.execute ('select sample_id from lims_sys.sample where (sample_id >
121)
and (sample_id < 130)')
   TypeError: an integer is required

## whatever this means...
## I am going to run it interactively now

   vixen: ~/python-test, 14
   vixen: ~/python-test, 14 python
   Python 2.2.1 (#1, Jul 12 2002, 16:36:08)
   [GCC 3.0.3] on sunos5
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import dco2 as DCOracle2
   >>> db = DCOracle2.connect('report', 'glblreport', 'glbl')
   >>> c = db.cursor()
   >>> c.execute ('select sample_id from lims_sys.sample')
   Traceback (most recent call last):
     File "<stdin>", line 1, in ?
   TypeError: an integer is required
   >>>
   >>>
   >>> ^D
   vixen: ~/python-test, 15

I am out of idea at this point.  Would you please give me a pointer or
explain what is going on?  I would appreciate it.

Thanks.

Tena Sakai