You can do this in SQLite ... but regardless of which DBD you use*, this technique will fail if the table is already gone when you issue the DROP command. It works like a charm if you add the drop statement after your code yacks the first time you try to ADD a table that already exists -- but as soon as something else DROP's the table, your script breaks "in the opposite direction," so to speak. I think mifflin's suggestion of "catching an exception" by trapping inside eval is a more robust solution.
* unless you are using something like MySQL that offers CREATE TABLE foo IF NOT EXISTS ...jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to 2Re: How should I handle $sth->execute() errors?
by jeffa
in thread How should I handle $sth->execute() errors?
by Plankton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |