Deleting existing rows of the table

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
vbeeram
Participant
Posts: 63
Joined: Fri Apr 09, 2004 9:40 pm
Contact:

Deleting existing rows of the table

Post by vbeeram »

Hi All,

I have a need to delete the records of a certain table at the end of the sequence . I have created a job for this where i am using a transformer(input) and a oracle stage(output) where the transformer only has output rows which is nothing but the columns of the particular table i'm trying to delete. and i have set the value of all of it as 0 . and i have given the constraint as LinkRowCount =1 .In the Oracle stage i have given the update action to be "Delete existing rows only "

But i see that the records are not getting deleted
I also was wondering if i can give a after job subroutine in the last job of the sequence where it deletes the records of the table i'm trying to delete.

If so could someone let me know what is the query i'm suppose to write in the after job subroutine .

Any help would be highly appraciated .

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

Re: Deleting existing rows of the table

Post by chulett »

vbeeram wrote:the transformer only has output rows which is nothing but the columns of the particular table i'm trying to delete. and i have set the value of all of it as 0.
Your problem in a nutshell. You have to pass the actual key values for the records you want deleted, you've said to delete records where those fields have a value of 0.
-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 could fake it with user-defined SQL, but you still have to pass a row with a key column.

Code: Select all

DELETE FROM tablename WHERE :1 = :1 AND col1 = 0 AND col2 = 0
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply