Page 1 of 1

Unable to delete matching record from table with no primary

Posted: Wed Nov 05, 2008 5:10 am
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

Posted: Wed Nov 05, 2008 7:14 am
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.

Posted: Wed Nov 05, 2008 7:40 am
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.