Xref: alice comp.databases.oracle.misc:35512
From: "Alan D. Mills" <Alan.Mills@icl.NOSPAM.com>
Newsgroups: comp.databases.oracle.misc
References: <7ltbc2$r1@nntpa.cb.lucent.com>
Subject: Re: BIG PROBLEM with NULL and Prepared Statements
Date: Wed, 7 Jul 1999 13:17:53 +0100
Lines: 49
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Message-ID: <37834309.0@145.227.194.253>
Path: alice!news-feed.fnsi.net!newspump.monmouth.com!newspeer.monmouth.com!remarQ-easT!supernews.com!remarQ.com!tank.news.pipex.net!pipex!warm.news.pipex.net!pipex!news.fjcomp.com!145.227.194.253!145.227.137.209

I haven't proved this but couldn;t you use DECODE to do this.

Choose a specific value of the field and decode that to NULL, assuming you
can identify a value to choose.

I.e.  if :FIELD is a string type then you could code the value to be
inserted as

DECODE(:FIELD, 'X', 'X', 'NULL', NULL, :FIELD)

the X-X mapping is so that that first result specified in the decode is not
NULL.

Should work, as long as you can id a value to represent NULL.

regards

Alan


Antonio Pascual wrote in message <7ltbc2$r1@nntpa.cb.lucent.com>...
>If i have a sentence like this
>
>INSERT INTO TABLE1 (FIELD1, FIELD3, FIELD3) VALUES (:FIELD1, :FIELD2,
>:FIELD3)
>
>i do the followind:
>
>parse
>bind
>for i = 0 to ...
>    load variables
>    execute
>next
>
>If the FIELD1 is of double type, and the value to insert is NULL, how i
pass
>the value?.
>
>i do the binding :FIELD1 with the variable dField1, for example.
>If the first iteration dField1 = 10, works ok, but if next are NULL, what
>must have dField1?.
>
>thanks.
>
>
>


