[Zope-DB] DataType is broken at all for Zope? (Was: Oracle Date in DCOracle2's Stored Procedure)

Matthew T. Kromer matt@zope.com
Mon, 20 Jan 2003 10:07:09 -0500

Bo M. Maryniuck wrote:

>On Friday 17 January 2003 17:02, Matthew T. Kromer wrote:
>>As such, you told Oracle to go figure out what the date "20030111" was,
>>and it probably wanted "2003-01-11" or "11-01-2003" or "01-11-2003"
>>depending on your date formatting settings.
>No. On "20030220" I have this error:
>	ORA-01861: literal does not match format string
>On anything else (nuts, working with it like a puzzle game) I always got:
>	ORA-01843: not a valid month
>I've made a little temporary tweak for DCOracle2.py (where your FIXME is on 
>1491 line) to know what exactly types Zope passes for a procedure. As I see, 
>there *is* OracleDate type passed, but still does not work. Here is a full 
>BEGIN :1 :=  PM.PM_08.INSERT_DAY_REPORT(:2,:3,:4,:5,:6,:7,:8); END; 
>with parameters (__repr__): 
>[<BindingArray object at 0x952e108>, OracleDate("2003-02-10 00:00:00"), 844L, 
>'Descr', 1, 10, 'Comment', <BindingArray object at 0x938aff8>] 
>args map: 
>["Val: <BindingArray object at 0x952e108>, Type: <type 'BindingArray'>}", 
>"Val: 2003-02-10 00:00:00, Type: <type 'OracleDate'>", 
>"Val: 844, Type: <type 'long int'>", 
>"Val: Descr, Type: <type 'string'>", 
>"Val: 1, Type: <type 'int'>", 
>"Val: 10, Type: <type 'int'>", 
>"Val: Comment, Type: <type 'string'>", 
>"Val: <BindingArray object at 0x938aff8>, Type: <type 'BindingArray'>"]

All IN/OUT parameters do need to be passed in; its  just the OUT only 
ones that don't need to be passed in.  I suspect the problem is actually 
in your error message parameter, where the binding array being created 
to handle the in/out string is actually too small or the wrong data 
type.  All BindingArray objects have type() and width() methods on them 
that will return their current type or width -- it would help to see 
those values to see if it is creating a mismatched buffer.

I can't tell what the width of that error message IN/OUT parameter is 
supposed to be -- I think the default size is 256 characters, but 
because you're passing in '' it may be creating it MUCH smaller ;)  One 
possibility is to pass in a much larger string of blanks for the error 
message e.g. ' ' * 4096