Unable to delete matching record from table with no primary

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
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Unable to delete matching record from table with no primary

Post by cosec »

I have a source sequential file with three fields and a target table with no primary key/s.

I need to delete those records where there is match in the table for those three fields.

I used a custom SQL as follows

delete from tbl_sample where A=? and B = ? and C = ? ;

but this does not seem to work...

any ideas as to how i could get this to work ?

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

Post by ray.wurlod »

You need to mark columns A, B and C as Key in your job design. "Key" in this context does not mean primary key - it means "search key" and gets the parameter markers to bind to the WHERE clause.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And why in the world use "custom" sql for something as simple as this? My rule? Only when absolutely needed, otherwise the stage generates the SQL.
-craig

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