468,257 Members | 1,481 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,257 developers. It's quick & easy.

Delete table command in DB2 SQL ?

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
1 8015
MMcCarthy
14,534 Expert Mod 8TB
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.

Similar topics

5 posts views Thread by Jan Suchanek | last post: by
3 posts views Thread by uninfmx | last post: by
3 posts views Thread by Stewart Graefner | last post: by
3 posts views Thread by Kevin M | last post: by
13 posts views Thread by =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.