On Tue, Dec 15, 2009 at 06:58:03PM +0100, Angelo scratched on the wall:
> Hi to everybody,
> 
> I'm using sqlite 3.6.16 both shell and C api.
> I need to make automatic check (from C code) of the opened database files 
> (not 
> connections) . With sqlite3_column_database_name I get just main, temp and 
> not 
> the name of the hard disk database file. From the shell I use pragma 
> database_list and it's ok, but it's a manual check, not automatic. Is there a 
> way to use the pragma database_list command and capture the output to make 
> the 
> automatic check in C code ?

  You can prepare the pragma call in C as well.  It will act like the
  result of a SELECT: if you're using sqlite3_exec() you'll get a
  callback for each row, and if you're using prepare/step, you'll need
  to step through each "row."

  You'll have to walk and parse the output yourself, however.  Being a
  pragma, there is no way to wrap a WHERE clause around it.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to