Too bad you aren't checking whether your actions succeed, and neither are you using transactions when you are modifying your database. Now your examples are equivalent of Perl code that isn't strict, doesn't have warnings turned on, and isn't checking the return values of system calls.


There's no execuse to not wrap your database modifying statements inside a transaction, and to not rollback on failure.

As for checking for the existance of a table, that's rather easy in Sybase and MSSQL:

SELECT 1 FROM sysobjects WHERE name = "whatever" -- Name of the table AND type = "U" -- User defined table. -- Use "S" for a system table.


In reply to Re: DBI recipes by Abigail-II
in thread DBI recipes by gmax

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":