However, this is a waste of resources or perhaps some typing, since you are creating a statement handle for a query that returns no rows. So the database handle has a built-in shortcut for just such a case. This is the do() method. The code below shows how it is used.

As an added bonus many drivers will return the number of rows affected by the query or –1 if an error occurred.

This shortcut 'do' function is great for doing DLL tasks however it does not take params so its usefulness is somewhat limited.

Placeholders for non Select Queries

The great thing about DBI is the Placeholders for Non Select Queries work in exactly the same way as 'Select' statement except they do not return any records but may return the number of rows effected.

It can even be used with params if you want by simply adding the bind values at the end of the method after a hashref for attributes