Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Fran711
Posts: 16
Registered: ‎02-20-2011
My Device: Not Specified
Accepted Solution

SQLite issues trying to list all tables

Hello everyone,

 

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.

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: SQLite issues trying to list all tables

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...


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
Fran711
Posts: 16
Registered: ‎02-20-2011
My Device: Not Specified

Re: SQLite issues trying to list all tables

Thanks. That seems to do the trick for now.
Please use plain text.