sqlite select tables

Feb 25, 2009 at 12:48am

sqlite select tables

Hello,

Having some fun with sqlite in maxmsp. Thanks for tutorial!
A lot of requests are working BUT I cannot have a list of the names of the tables themselves.

I have try
exec “show tables”
exec “.tables”
or
function get_tables(){
var database=arguments[0];
exec(“SELECT * FROM ‘”+database+”‘ WHERE type=’table’ ORDER BY name”);
}

No success…
Need a little help.
Thank you
Roland

#42508
Feb 25, 2009 at 3:25pm

small solution.
I generate tables names trough a autopopulate umenu…

#152096
Feb 25, 2009 at 4:41pm

You can do that using the sqlite_master table.

SELECT * FROM sqlite_master

It’s explained in the Querying the SQLITE_MASTER table paragraph.

#152097
Feb 25, 2009 at 5:12pm

Thanks it works!
Vive ej!

#152098

You must be logged in to reply to this topic.