| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: BIG PROBLEM with NULL and Prepared Statements
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_at_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.
>
>
>
Received on Wed Jul 07 1999 - 07:17:53 CDT
![]() |
![]() |