Generating GUIDs in DataStage

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
billsklar
Participant
Posts: 17
Joined: Tue Jul 13, 2004 9:42 am

Generating GUIDs in DataStage

Post by billsklar »

I've read the recent posts on this topic but have not seen a clear answer either way. Is there any way to pass a SQL generated GUID to DataStage? When I attempt this I just get a "0." Any advice would be greatly appreciated.

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

Post by chulett »

So, it sounds more like you are able to generate them but not successfully run them through a DataStage job? It's just (basically) a big number, yes?

What have you tried so far? It would help to know what you are currently doing that gets you the "0" output. If you are having issues processing a large number, perhaps a Varchar field will do the trick. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,
How are you reading this in datastage?
Is it coming from a table where it was generated using SQL server Newid() function. I understand this is stored as 16-byte binary value.

Ketfos
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Search the Forum. I posted this eons ago. The easiest way is to use a CAST - VARCHAR(36) if you don't want quotes, VARCHAR(38) if you do want quotes.

Code: Select all

SELECT CAST(MyGUID AS VARCHAR(38)) FROM tablename;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply