• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Getting a list of all the tables in a database

danbar

Lurker
Hi,

I'm looking for a way to get a list of all the tables in an android database. Is there anything like the Oracle select * from user_tables?

Thanks
 
Welcome to the forum! :D

I'm sorry it took so long for anyone to reply to you - I saw you post on the first day, but don't have a solid answer for you.

This Stackoverflow thread discusses a problem similar to yours, and suggests a number of tools to peek into the phone's databases. Although I get the impression that you want to do this runtime, it may still be a step forward.

I suppose you do know about the Android developer's site, right? I haven't tried what you're trying to do; I suspect that (similar to how the Intents (don't) work) there's just no way of obtaining that information unless you already know it. :( Perhaps in a future API improvement release?

Good luck though, and welcome again.
 
I haven't tried this on Android, but with SQLite you would normally do

SELECT * FROM databasename.sqlite_master WHERE type='table';
 
Back
Top Bottom