date conversion

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

deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

date conversion

Post by deva »

Hi ,
I am trying to load the data from file to database.

file have one date column begin_date its data type is timestamp(19), target database column type is timestamp (38). while loading the data I am getting the error, date for mante not supporting.

can any one suggetst on this.
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

Please post the input date format here .
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

What's the target database and can you paste the DML.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

Please always paste the exact error message, not translate it or anything like that.
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Post by deva »

Teej wrote:Please always paste the exact error message, not translate it or anything like that.
I am getting the follwoing error

Db_Insurance_Policy_Period..Risk_Tfm: DBMS.CODE=ORA-01861
Db_Insurance_Policy_Period..Risk_Tfm: ORA-01861: literal does not match format string
nivas
Participant
Posts: 117
Joined: Sun Mar 21, 2004 4:40 pm

Post by nivas »

use IConv and OConv datastage functions convert the input value appropriate to Oracle Date format. Look for Online document for IConv and OConv with different options.
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Post by deva »

nivas wrote:use IConv and OConv datastage functions convert the input value appropriate to Oracle Date format. Look for Online document for IConv and OConv with different options.
I am using the following function

Oconv(Iconv(DSLink44.BEGIN_DATE , "D YM"), "D4/MDY")

it inserting nulls. its not null col. so all are rejecting
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Post by deva »

deva wrote:
nivas wrote:use IConv and OConv datastage functions convert the input value appropriate to Oracle Date format. Look for Online document for IConv and OConv with different options.
I am using the following function

Oconv(Iconv(DSLink44.BEGIN_DATE , "D MDY"), "D4/MDY")

it inserting nulls. its not null col. so all are rejecting
nivas
Participant
Posts: 117
Joined: Sun Mar 21, 2004 4:40 pm

Post by nivas »

using IsNull datastage function handle the nulls set a default value
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

Deva,

First of all you need to provide the input date format looks like .

It is not possible for anyone of us to provide right solution without this information.
Last edited by paddu on Tue Feb 12, 2008 12:48 pm, edited 1 time in total.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Iconv and Oconv have nothing to do with nullability. If your column contains nulls, add something like

Code: Select all

IF IsNull(DSLink44.BEGIN_DATE) THEN '01/01/2000' ELSE Oconv(Iconv(DSLink44.BEGIN_DATE , "D MDY"), "D4/MDY") 
rsomiset
Premium Member
Premium Member
Posts: 46
Joined: Fri Sep 21, 2007 7:16 pm

Post by rsomiset »

Once again, you make sure that the incoming data is not null. If not, then use the iconv function with the format that your data is coming.
--
Raj
rsomiset
Premium Member
Premium Member
Posts: 46
Joined: Fri Sep 21, 2007 7:16 pm

Post by rsomiset »

Once again, you make sure that the incoming data is not null. If not, then use the iconv function with the format that your data is coming and oconv function in the format that you want.
--
Raj
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Post by deva »

rsomiset wrote:Once again, you make sure that the incoming data is not null. If not, then use the iconv function with the format that your data is coming and oconv function in the format that you want.
Hi All,
date column have value. But while converting null is comming out.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Are you talking about a NULL or an empty string? The former, in Server, can only occur if the input is already NULL!
Post Reply