Date to Timestamp conversion in Transformer.................

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
akansha123
Participant
Posts: 9
Joined: Sat Mar 18, 2006 1:53 pm

Date to Timestamp conversion in Transformer.................

Post by akansha123 »

Hai,
I need to lookup for date field in sequential file into the timestamp in the oracle table.How can i do that.
Ex:20060405 in sequential file to be lookup to the the
2006-04-05 00:00:00 in the oracle table
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Use ICONV to change them into internal format. For date coming in from oracle, use substring to extract the first 10 characters (Date Part) and apply ICONV to it. Then do your comparison.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

ICONV() won't work in a PX job. So you will need to convert this string date to the correct string format then use StringToDate() or a similar function or use the cast capabilities within your Oracle query.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Marked as Server...
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Yea, thats what i thought. If its server, then use my suggestion, if its px, use ArndW's suggestion.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Marked as Server in the PX forum. Who knows which it is... Only the shadow knows 8)
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Again we are left at the mercy of the guessing monster. :twisted:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply