[Zope-DB] DCOracle2 problem on Solaris 8

Antonio Orlando aorlando2002@yahoo.com.br
Wed, 17 Jul 2002 12:03:07 -0400


Does the user 'report' have 'select' permission on the 'scott' schema?=20
just another point of view... this code runs fine in my db...(runned in=20
python 1.5, thought...)

hth,

Antonio Orlando


tenasakai@earthlink.net wrote:

> Hello Fabiano,
>=20
> Thanks for your suggestion.  I reinstalled Python 2.1.3 as well as Zope=
 2.5.1
> (which in turn necessitated installing DCOracle2).  In short, I have:
>=20
>        Python:    2.1.3
>        Zope:      2.5.1
>        DCOracle2: 1.1
>=20
> But I see no change in the behavior of my python script.
> Ie.,
>=20
>    vixen: ~/develop/python/dcoracle2, 129 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
>    >>> db=3Ddco2.connect('report','glblreport','glbl')
>    >>> c =3D db.cursor()
>    >>> c.execute("select * from scott.emp")
>    Traceback (most recent call last):
>      File "<stdin>", line 1, in ?
>    TypeError: an integer is required
>    >>>
>    >>> ^D
>    vixen: ~/develop/python/dcoracle2, 130
>=20
> I'd appreciate it if you have different suggestion.
>=20
> Tena Sakai
>=20
>=20
> On 16 Jul 2002 14:34:51 -0300 Fabiano Weimar dos Santos <fabiano@x3ng.c=
om.br>
> wrote:
>=20
> Hi
>=20
> try to install Zope 2.5.1 version with Python 2.1.3. I dont know what i=
s
> the latest version of DCOracle, but i think that you are not using the
> latest stable version (sorry if i'm wrong). The Python 2.2 will be used
> only in Zope 3 (or some other version that doens't exist yet).
>=20
> Ate +
>=20
> Em Seg, 2002-07-15 =E0s 21:44, tenasakai@earthlink.net escreveu:
>=20
>>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.
>=20
>>   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 =3D DCOracle2.connect('report', 'glblreport', 'glbl')
>>   c =3D 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 =3D DCOracle2.connect('report', 'glblreport', 'glbl')
>>   c =3D 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
>>
>=20
>>   vixen: ~/python-test, 11
>>   vixen: ~/python-test, 11 cat - >> t.py
>>
>>   c.execute ('select sample_id from lims_sys.sample where (sample_id >=
 121)
>>
>=20
>>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 =3D DCOracle2.connect('report', 'glblreport', 'glbl')
>>   c =3D db.cursor()
>>
>>
>>   c.execute ('select sample_id from lims_sys.sample where (sample_id >=
 121)
>>
>=20
>>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 informatio=
n.
>>   >>> import dco2 as DCOracle2
>>   >>> db =3D DCOracle2.connect('report', 'glblreport', 'glbl')
>>   >>> c =3D 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
>>
>>
>>
>>_______________________________________________
>>Zope-DB mailing list
>>Zope-DB@zope.org
>>http://lists.zope.org/mailman/listinfo/zope-db
>>
>>