Page 1 of 1

string to date conversion

Posted: Fri Apr 25, 2008 1:44 pm
by kollurianu
I have input value in the file as varchar(10) as yyyymmdd /yymmdd , I got to insert into the oracle database as date field.

Before writing to table I am just converting the string to date format and writing to a file for testing purposes which is not working and job is aborting.Following the function used for conversion.

StringToDate(DSLink92.PROCESS_DATE, "%yyyy-%mm-%dd%" )

Any inputs greatly appreciated.

Posted: Fri Apr 25, 2008 2:24 pm
by kollurianu
Now the function is working with some warnings
as below:

APT_CombinedOperatorController(1),0: Conversion error calling conversion routine date_from_string data may have been lost

And I have the Null field value set to 1950-01-01 to the date fields in the column properties.

Is that the right way set Null properties on the target file side.

Thank you all.

Posted: Fri Apr 25, 2008 2:48 pm
by kollurianu
All the Null dates are being written as ********** in the output file.

Posted: Sat Apr 26, 2008 12:41 am
by kumar_s
if you input format is differnt use the derivatin as StringToDate(DSLink92.PROCESS_DATE, "%yy%mm%dd%" )

Posted: Mon Apr 28, 2008 1:07 pm
by savis
Hi,

hope this helps..

If Len(StageVar)=6 Then StringToDate(StageVar,"%2000yy%mm%dd") Else StringToDate(StageVar,"%yyyy%mm%dd")

Thanks,
Savis