user defined query in odbc

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
rgr
Participant
Posts: 13
Joined: Wed Apr 29, 2009 6:13 pm

user defined query in odbc

Post by rgr »

Hi,
How to write a user defined query in ODBC stage, I know there is user defined option, Here are the details, I have A, B, C columns from the source link and I need to delete the records in target table having col X,Y Z, P, Q, R using where condition X =A and Y=B and Z<=C.

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

Post by chulett »

The best way? Let the stage generate it so you get the bind parameters correct and then... tweak it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You don't even need user-defined SQL for this. Simply use DataStage to filter the rows needing deleting) and pass them to a straightforward DELETE in the target stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rgr
Participant
Posts: 13
Joined: Wed Apr 29, 2009 6:13 pm

Post by rgr »

Thank you craig and ray, I used user defined query as suggested by you.
Thanks,
RGR
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As Ray noted - best practice is to only use "user-defined" SQL when you have no other choice, otherwise let the stage generate the SQL. A "normal" delete will work just fine for this.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply