Deleting rows from an SQL 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
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Deleting rows from an SQL table

Post by gpbarsky »

Hi, my friends... :D

Given a file which is composed by keys of a table, I need to delete the rows of the table corresponding to the keys of the file. I mean, for each record of the file, I need to delete the rows of the table.

How can I do this ?

Thanks in advance.
Guillermo P. Barsky
Buenos Aires - Argentina
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Read the file and send the keys to your database stage of choice using the 'Delete existing rows' update action. Easy Peasy.
-craig

"You can never have too many knives" -- Logan Nine Fingers
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

You could design your job like below

Code: Select all

Sequential File Stage -------> Transformer -------> DRS Stage

You can specify "Delete existing rows only" in the target stage.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Thanks, but I have not the option for deleting rows. I'm using the ODBC stage.
Guillermo P. Barsky
Buenos Aires - Argentina
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then either switch to the DRS stage, which does have that option for ODBC, or use user-defined sql.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

chulett wrote:Easy Peasy.
Been watching "The Greatest Game Ever"?
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Lemon squeezie. :lol:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Me too.
Mamu Kim
Post Reply