Getting a list of all the tables in a database


Last Updated:

  1. danbar

    danbar New Member This Topic's Starter

    Joined:
    Jun 7, 2010
    Messages:
    1
    Likes Received:
    0
    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

    Joined:
    May 29, 2009
    Messages:
    1,217
    Likes Received:
    130
    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. IanGClifton

    IanGClifton Well-Known Member

    Joined:
    Feb 7, 2010
    Messages:
    111
    Likes Received:
    19
    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...