cannot insert NULL into PRICE_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
sateeshbabu
Participant
Posts: 48
Joined: Sat Oct 22, 2005 9:56 am

cannot insert NULL into PRICE_DATE

Post by sateeshbabu »

Hi Folks,

Actually from source i am getting price_date as varchar.First i need to ftp'ed the file and then should load into database.But while loading database i need to convert the price_date of string format to date.

i had defined price_date as


If IsNull(Lnk_Sp_ims_investec.PRICE_DATE) Then '' Else (Oconv(Iconv(Lnk_Sp_ims_investec.PRICE_DATE,"D/ MDY"),"DMDY"))

But i am getting a warning like cannot insert null into Price_date.

Could any body suggest me to solve this.

Thnaks i advance.
Sateesh.M
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

Which is the database?

If it is Oracle, then I guess you might need to put ' ' instead of '', because Oracle treats '' as null.
Regards,
S. Kirtikumar.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

What is the exact error message? Check for nullability in the target table as well as the Load stage. By the way, why do you need to check for Null if you need to load Null based on the availablility of null in input?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
info_ds
Charter Member
Charter Member
Posts: 88
Joined: Thu Feb 10, 2005 4:36 am
Location: B\'lore

Post by info_ds »

Hi ,

First thing it is clear that the target column is non-nullable .
Check the source whether any null values are coming ,if there is some null values coming change that to a hardcoded value.when you are reading from the flatfile isnull routine does not read as null so make that as if input.col1 =" " then "some value".

Hope this will work out
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Flat file cannot change Null into a space " ", unless a conversion is used or an internal property is assigned.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
sateeshbabu
Participant
Posts: 48
Joined: Sat Oct 22, 2005 9:56 am

Post by sateeshbabu »

Hi Friends,

Thanksalot for your inputs.In source we are not getting as null.We are getting in the format of mm/dd/yyyy.

My targetdatabase is oracle.In query i had changed To_Date of price_date then it worked well.I had deleted the routine.

Thanks again for your inputs.

Regards,
Sateesh.M
Post Reply