By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,756 Members | 1,757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,756 IT Pros & Developers. It's quick & easy.

Delete table command in DB2 SQL ?

P: 48
Hi,

I want to execute below SQL in DB2 :

DELETE temp1 FROM temp1 INNER JOIN TEMP2 ON temp1.IBPSUB = TEMP2.IBPSUB
AND temp1.IBPQTN = ( CASE WHEN TEMP2 .IBPQTN > 80 THEN TEMP2 .IBPQTN-80 END);


I m getting this error after exceute :

ERROR [42601] [IBM][CLI Driver][DB2] SQL0104N An unexpected token "TEMP1" was found following "". Expected tokens may include: "FROM ". SQLSTATE=42601



I can run the same query in SQL Server 2000 with no issue. I am new to DB2 area. Please let help me about above delete command.

Regards,
Santosh
Jun 25 '07 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
I don't know how this is running in SQL Server 2000 without an issue. The correct syntax for a delete query is:

DELETE TableName.* FROM TableName

If you didn't have a SQL Join you could just use

DELETE FROM TableName
Jun 27 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.