Order by Clause in DB2 Enterprise stage

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
rony_daniel
Participant
Posts: 36
Joined: Thu Sep 01, 2005 5:44 am
Location: Canada

Order by Clause in DB2 Enterprise stage

Post by rony_daniel »

Hi All,

I am reading a db2 table in Datastage with DB2 Enterprise stage and using the Read Method = Table. I want to give a order by clause to the columns selected using the select list property. Where do I specify this? I tried to give it in the where clause property though I don't have a where clause, as follows:-

1 = 1 order by cust_id

This is not woking. Is there a work around for this problem other than changing the Read Method?
Thanks & Regards,
Rony
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Order by Clause in DB2 Enterprise stage

Post by sud »

No there isn't, you have to override the SQL.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Read Method = Table is a direct read - it does not provide for ORDER BY. Nor GROUP BY nor HAVING for that matter. This is why/how it is fast.

If you want DB2 to sort the data you must use one of the SQL-based read methods.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rony_daniel
Participant
Posts: 36
Joined: Thu Sep 01, 2005 5:44 am
Location: Canada

Post by rony_daniel »

Thanks Ray and sud.
Thanks & Regards,
Rony
Post Reply