11-24-2011 1:10 PM
Hello everyone,
I'm using ADBC (like EXEC SQL OO) to insert values into an external database.
I need to insert null value into the fields type date.
I've already tried all the possibilities I can imagine...
TO_DATE('null'), only 'null', 'NULL' yyyymmdd, ddmmyyyy, 00.00.0000, 00000000, 00-00-0000, 00/00/0000, 00.00.0000 00:00:00, DECODE, space, ' '.
The only one that worked was ie 24-nov-2011.
But with this format, I can't insert NULL.
Do someone know how could I do?
Tks in advance.
Flavio.
PS: I'm using the GET REFERENCE functionallity.
11-24-2011 1:29 PM
Hi Flavio,
I'm able to pass 'NULL' value to a Date field in ORACLE using Native SQL provided the date field defined in ORACLE is of type 'DEAULT NULL'.
The value passed by the code is 'NULL' as is accepted in the destination system.
Regards,
Pranav.
11-24-2011 2:54 PM
Pranav,
I've made the field receive NULL as default in Oracle database, but I still facing the same problem.
Tks anyway.
Flavio
11-25-2011 4:36 AM
Hi Flavio,
I can suggest 2 ways to verify the porblem:
1. Try manually inserting the record in the ORACLE DB. If no errors then the data string needs to be verified.
2. If feasible, create another table in ORACLE DB without any foreign keys or complex data types. Simple table with a Unique Key and a NULL field. Send data to this Table and if successful, maybe you'll get some hints.
Regards,
Pranav.
11-25-2011 6:03 AM
hi ,
First check whether in your oracle table - date is part of primary key or not ?
if it is part of primary key with constraint of not acccepting NULL values then it will give error .
regards
Deepak.
11-25-2011 1:17 PM
Tks, but I've already tried these solutions...
I checked on the debug and I'm using exactly the same statement...
On TOAD( Oracle Viewer ) the statement works... On my method, don't.
The field has no constraints and is not part of the pk.
Regards,
Flavio.
11-26-2011 4:05 AM
hi ,
Dont pass value in "NULL" Codes ,
just pass null .
regards
Deepak.
01-09-2014 7:34 PM