1. Check out our companion app, Forums for Android! Download from Google Play

Getting a list of all the tables in a database

Discussion in 'Application Development' started by danbar, Jun 7, 2010.

  1. danbar

    danbar New Member
    Thread Starter
    5

    Jun 7, 2010
    1
    0
    5
    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
     

    Advertisement

  2. KlaymenDK

    KlaymenDK Well-Known Member
    143

    May 29, 2009
    1,217
    130
    143
    Denmark
    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.
     
  3. I haven't tried this on Android, but with SQLite you would normally do

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

Share This Page

Loading...