in reply to DBI "drop table" next obstacle
MySQL has a special syntax that will tie your soul to MySQL but otherwise work:
drop table X if exists;
Personally, I prefer a Perl solution to this problem:
sub tableExists { my ($dbh, $tableName) = @_; my $exists = 0; #my $cursor = $this->{dbh}->table_info('%','%',$tableName,'TABLE') +; my $res = eval { my $cursor = $dbh->prepare("select * from $tableName where 1 = + 0"); $cursor->execute(); $cursor->finish; 0E0 }; return defined $res; }
The ->table_info method would be the real DBI way, but unfortunately, ->table_info isn't implemented in all cases where I needed it.
|
|---|