Page 1 of 1

Delete rows using datastage

Posted: Thu Nov 27, 2003 9:35 am
by yiminghu
Hi,

I am doing a project converting stored procedure to datastage. I am wondering whether you can use datastage to delete rows, here is the original sql statement.

DELETE FROM IN_PLAYER_MASTER
WHERE
Acct IN (Select Player_Acct_Num FROM EXD_PLAYER_MASTER )

I was trying to use user-defined SQL, but when I executed the job, I got bouch of warnings.

Any suggestions? Or using stored procedure is my only choice.

Thanks,

Yiming

Re: Delete rows using datastage

Posted: Thu Nov 27, 2003 10:51 am
by jseclen
Hi Yiming,

What kind of database use???

Can you explain how is and work your job ???

8)

Re: Delete rows using datastage

Posted: Thu Nov 27, 2003 11:55 am
by Teej
Oh. You were doing just one stage, I suspect?

Do this:

2 database stages:

[input] -> [output]

For Input: Select [field] from [table]

For output: Delete from [table] where [field] = [input column]

-T.J.

Posted: Thu Nov 27, 2003 12:29 pm
by kcbland
Just run this as a sql script from either a BATCH job using DSExecute or from a command stage. Use the appropriate command line syntax for your unspecified database. If Informix, use dbaccess. If Oracle, use sqlplus. If SQL-Server or Sybase, use isql. If DB2, well, someone give that answer. :oops:

Re: Delete rows using datastage

Posted: Thu Nov 27, 2003 12:46 pm
by yiminghu
Thanks, everybody. The problem has been resolved. I made a typo in the SQL statement.