[Zope-DB] Oracle Date in DCOracle2's Stored Procedure

Bo M. Maryniuck b.maryniuk@forbis.lt
Fri, 17 Jan 2003 15:30:04 +0200


Hi.

There is a problem (bug?) to pass a DATE type argument to stored procedur=
e.
Worse, that a half-working stuff. From a pure Python all works (!) fine:

*bo@zope:(~/test) python
Python 2.2 (#1, Mar 26 2002, 15:46:04)=20
[GCC 2.95.3 20010315 (SuSE)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import DCOracle2 as o
>>> cc =3D o.connect('luser/buzzword@somebase')
>>> c =3D cc.cursor()
>>> c.procedure.pm.pm_08.insert_day_report('20030111', 1330L, '11', 11, 1=
1, '11', '')
[13472, '\x00']
>>> print c.procedure.pm.pm_08.insert_day_report.__doc__                 =
                 =20
function PM.PM_08.INSERT_DAY_REPORT returns OUT NUMBER, has arguments:
        P_DT IN DATE
        P_ACL_ID IN NUMBER
        P_DESCRIPTION IN VARCHAR2
        P_SPENT_DAYS IN NUMBER
        P_DONE_PRC IN NUMBER
        P_COMMENT IN VARCHAR2
        P_ERR_MSG IN OUT VARCHAR2

Now, from Zope (Z Oracle Stored Procedure) I got this:

File /opt/zope/lib/python/Products/ZOracleDA/DCOracle2/DCOracle2.py, line=
 1492, in __call__
    (Object: PM.PM_08.INSERT_DAY_REPORT)
  File /opt/zope/lib/python/Products/ZOracleDA/DCOracle2/DCOracle2.py, li=
ne 973, in execute
DatabaseError: (1861, 'ORA-01861: literal does not match format string\nO=
RA-06512: at line 1')

This error is quite common and means that I've passed wrong date. If I ca=
ll it from a Python Script with the same=20
code as above I use in pure Python, it returns me the same error. How to =
kick it run under Zope? Note, that I can't
change P_DT variable to VARCHAR2 type inside the func.

--=20
Regards, Bogdan

This company has performed an illegal operation and will be shut down. If
the problem persists, contact your vendor or appeal to a higher court.