convert TimeStamp

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
praburaj
Premium Member
Premium Member
Posts: 133
Joined: Thu Jun 30, 2005 1:26 am
Location: philippines

convert TimeStamp

Post by praburaj »

Hai,

I have one problem.

My Source column is

AGG_EFF_SOURCE_DATE

AGG_EFF_END_DATE


This Column Datatype is Time Stamp. Here, my condition is i need

convert Time Stamp DataType (MM/DD/YYYY HH:MM:SS) in to (DD-MON-

YYY).

EX:

INPUT:

03/15/2006

OUTPUT:

15-FEB-2006.

In my job i am using

OCISTAGE_SOURCE, TRANSFROMER,OCI_TARGET


How Can I do that. Can any one help me.


Regards,

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

Post by chulett »

You don't need to 'convert' anything. Simply declare the datatype for the Oracle DATE field as Timestamp on both source and target, let the stages generate the sql and you'll be fine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi Chulett
Can we do something like this too:

Code: Select all

 
 Oconv(Iconv(i/p,"D/MDY[2,2,4]"),"D-DMY[,A,]") 
 
I want to check whether it is possible or not.

Thank you.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure, it's possible - just completely unnecessary. :?

If you do it, make sure you use the right format mask on the target side. Or the dangerous practice of using a varchar and matching the default date format for your target. It may work, but is a Very Bad Practice as far as I'm concerned.
-craig

"You can never have too many knives" -- Logan Nine Fingers
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Thank you Chulett. I got it..
chulett wrote:Sure, it's possible - just completely unnecessary. :?

If you do it, make sure you use the right format mask on the target side. Or the dangerous practice of using a varchar and matching the default date format for your target. It may work, but is a Very Bad Practice as far as I'm concerned.
praburaj
Premium Member
Premium Member
Posts: 133
Joined: Thu Jun 30, 2005 1:26 am
Location: philippines

Post by praburaj »

Hai meena,

I am using my source is a timestamp. If u got it, How can u do that?

can u help me :?

Regards,

prabu
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

chulett wrote:You don't need to 'convert' anything. Simply declare the datatype for the Oracle DATE field as Timestamp on both source and target, let the stages generate the sql and you'll be fine.
That answers everything. Doesn't that?
Did you try what chulett suggested?
What result you got?
Success consists of getting up just one more time than you fall.
Post Reply