To delete records in a table in DB2 database DELETE command is used, this command is well known in other databases and their use is similar in DB2.


As shown in the above syntax, the DELETE command only needs to receive as parameter the name of the table, but there is a very important item to be considered. When using the command as shown before all records are deleted and in many cases this format does not apply, due the WHERE clause is used with it.

DELETE FROM [Table] WHERE [Conditional]

In the syntax shown earlier, only records that satisfy the conditional will be deleted. As a practical example we will delete products from a table using both formats.


DELETE FROM product WHERE cod_prod = 1

n the first example all products will be deleted from the table, in the second only the product that has the code 1 will be deleted.


DB2 has gained more space in web development environments and because it understand it works becomes a great advantage. So, discover the advantages of working with DB2 on PHP projects on our official site.

By ,

October 2, 2013


You might also like…

5 reasons you can’t miss a Black Friday Scriptcase!

This November we bring you the biggest and most important discounts of the year! And do you know wh...

Taking a look at Scriptcase version 9.7

After the big Scriptcase 9.7 presentation event, we have a new version of Scriptcase for download, ...

October Newsletter

Follow the latest news for the month of October! Webinars, blog posts, videos, and more. WEB...

You might also like…

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at Learn more about our Privacy Police.