[Zope-DB] DCOracle2 OracleDate and parameter sequence problem

Matthew T. Kromer matt@zope.com
Thu, 11 Oct 2001 10:19:36 -0400


This is a multi-part message in MIME format.
--------------080607030804000003010506
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Christopher Jenkins wrote:

>
>As you suggested, I have attached the tracedump for the case where
>the setStatic line is in its origional (uncommented) state.  I hope
>this is helpful.
>
>Thanks for your help with this issue.
>
>Chris
>

OK, the trace showed me things were apparently working as expected.  So, 
what I think is happening is that Oracle 9i is being picky, and actually 
checking that when an indicator is set (indicating a NULL value) that 
the value that is NULL is well formed (which seems, well, silly).  So 
this patch will set both the indicator and use an empty string "" to 
represent NULL.  My test program still works, so I think it's a harmless 
patch regardless.

--------------080607030804000003010506
Content-Type: text/plain;
 name="o9i.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="o9i.diff"

Index: src/dco2.c
===================================================================
RCS file: /cvs-repository/Products/DCOracle2/src/dco2.c,v
retrieving revision 1.91
diff -u -r1.91 dco2.c
--- src/dco2.c	5 Oct 2001 14:41:45 -0000	1.91
+++ src/dco2.c	11 Oct 2001 14:16:03 -0000
@@ -450,6 +450,7 @@
 #endif
 
 UNUSED static char ID[]="$Id: dco2.c,v 1.91 2001/10/05 14:41:45 matt Exp $";
+const static char NULLSTR[]="";		/* for null string bind	*/
 
 
 /*-----------------------------------------------------------------------
@@ -2350,6 +2351,11 @@
 		if (bind->dty == 0)
 			bind->dty = SQLT_STR;	/* Nulls are STRING if there
 						** wasnt a prior type bind */
+		if (bind->dty == SQLT_STR) {
+			bind->valuesz = 1;
+			bind->valuep = (char *) NULLSTR;
+
+		}
 		bind->ind = -1;		/* do we need more if it is null? */
 	} else if (object->ob_type == &BindingArrayObjectType) {
 		BindingArrayObject *bao = (BindingArrayObject *) object;

--------------080607030804000003010506--