Page 1 of 1

Generating GUIDs in DataStage

Posted: Mon Jan 10, 2005 10:46 am
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

Posted: Mon Jan 10, 2005 1:24 pm
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. :?

Posted: Mon Jan 10, 2005 1:27 pm
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

Posted: Mon Jan 10, 2005 3:03 pm
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;