NUll to oracle date

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

NUll to oracle date

Post by edward_m »

I am trying to insert null value to oracled nullable date,somehow its generating error called
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
I am not putting any condition in transformer,i am simply inserting this into oracle nullable date.
Please let me know how to insert null value to oracle nullable date.

Thanks in advance..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

A nullable date should take a null without issue. Doesn't sound like you are inserting what you think you are inserting. Why not try replacing the OCI stage with a Sequential File stage and see what ends up in the file?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Make sure you really are sending it a NULL, not "" (which is not the same thing) or some default value where the year is out of range.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: NUll to oracle date

Post by sachin1 »

i agree with chulett their should be no problem.
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post by crouse »

i also agree with chulett their should be no problem.

(Hey, just trying to get my post count up. Trying to catch up with chulett. I have 11,000 to go.) ;-)

(Just a little levity on a Friday morning.)

Ray, actually inserting '' (no space) into a nullable field does insert a null, for Oracle.

CREATE TABLE HDR_005001.Craig_test (
EFFECTIVE_START_DT DATE NULL
)

INSERT INTO HDR_005001.CRAIG_TEST(EFFECTIVE_START_DT)
VALUES('')
GO

select * from HDR_005001.CRAIG_TEST

EFFECTIVE_START_DT
---------------------
(null)

1 record(s) selected [Fetch MetaData: 0/ms] [Fetch Data: 0/ms]

[Executed: 6/22/07 8:25:02 AM MDT ] [Execution: 125/ms]


-Craig
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Learned something today. Not a wasted day. Thanks, Craig.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply