07-01-2011 11:04 PM
I've been using SQLite for persistent storage in my app and have run into the problem of not being able to list all the tables in my database. According to: http://www.sqlite.org/faq.html#q7
The correct way is:
SELECT name FROM sqlite_master WHERE type='table'ORDER BY name;
But FlashDevelop rejects that saying:
A) name does not exist as a column
B) sqlite_master does not exist as a table
C) type does not exist as a column
Is there a special way to do this inside the AIR environment? Or am I making an obvious mistake?
Thank you for your time.
Solved! Go to Solution.
07-02-2011 08:58 AM
I can't answer at the moment exactly why accessing sqlite_master may not work, other than to say it's likely the Flash SQL layer is interfering with that. Same reason you can't issue "PRAGMA" statements.
On the other hand, flash.data has support for what you want built into it, in the form of the loadSchema() function. Under the covers it's almost certainly using "select * from sqlite_master", so it's your best bet all around...