Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Log4perl: Create missing SQLite file and log to it

by Marshall (Canon)
on May 10, 2019 at 03:20 UTC ( [id://1233547]=note: print w/replies, xml ) Need Help??


in reply to Re: Log4perl: Create missing SQLite file and log to it
in thread Log4perl: Create missing SQLite file and log to it

Yes, querying sqlite_master is another way. I used this formulation last time I did this, probably an even better formulation is possible:
my $check_if_bracket_table = $dbh->prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'Brackets'"); $check_if_bracket_table->execute(); my $ref = $check_if_bracket_table -> fetchall_arrayref; if (@$ref >0){...} # the Bracket Table exists...
Update: the sqlite_master table contains a lot of meta information about the DB. A lot more can be discovered than just whether a table exists or not. I am not an SQL guru, this is something I did last year to solve a problem. I had to do some stuff with the Brackets table, if it existed. Otherwise there were some rules about how to deal with situation.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1233547]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-03-28 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found