Use a specific database & find it's tables.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zensunni
    New Member
    • May 2007
    • 101

    Use a specific database & find it's tables.

    In MySQL, I would just go:

    "use <database name>;"

    Is there an equivalent in Oracle? Also, how would I list all the tables in my database?

    Thanks.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    In oracle to use any database you need to connect to that first. and to connect you need to pass user name,password and the name of the database.

    and to select the tables query DBA_TABLES.

    TRY USING THIS
    [code=oracle]select owner,count(tab le_name) from dba_tables group by owner;[/code]

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Hi,

      Try any of these:

      [code=oracle]
      Select * From Tab Where TabType='TABLE'

      SELECT * FROM user_tables

      SELECT * FROM dba_tables
      WHERE owner = 'MY_SCHEMA_NAME '

      [/code]

      Regards
      Veena

      Comment

      • zensunni
        New Member
        • May 2007
        • 101

        #4
        I should have just tested the create table command, but I was just so used to MySQL where you have to select your database first. I feel kind of slow now.

        Anyways, thanks for the commands! :)

        Comment

        Working...