How can I list all tables in a database with Squirrel SQL?

43,562

Solution 1

You can do it easily from the GUI. After you open your session, click the Objects tab, then expand the tree. Expand the db, schema, and then table nodes, and you'll see all of your tables. If you click on a particular table node, a table will open to the right. By clicking the Columns tab, you can get the column names, types, and other meta data.

Or are you looking for SQL commands?

Solution 2

Sometimes I noticed that doing the above may not result in the tables showing. Before I figured this out, my table node will not be expandable and I can never get a list of the tables.

After a lot of searching on the internet, I learnt that you need to choose the schema from the catalog drop down box located at the upper left portion of the squirrel sql client before the icons to be able to get the table list for that particular schema.

Hope that helps.

Solution 3

I know this is quite an old question. I was stuck with this for the last 3 days (google search results didn't help) I'm using Squirrel 3.4 and had to connect to a old DB2 database. I could connect to the DB but could not see the tables for 3 days. Finally got it, here is what worked for me -

  1. Edit Alias Properties -> click properties - select the radio button "Specify schema loading and caching" -> click on "Connect database and refresh Schema table".
  2. Once you do this all the schema's are loaded in the pop up window.
  3. Select the ones you need and change the option to 'Load and cache'. Reconnect to this session.
  4. Select the schema name from the catalog drop down and refresh
Share:
43,562
Jonas
Author by

Jonas

Passionated Software Developer interested in Distributed Systems

Updated on July 09, 2022

Comments

  • Jonas
    Jonas almost 2 years

    I use Squirrel SQL to connect to a JavaDB/Derby database on my desktop. I can run SQL queries.

    But how can I list all tables in the database? And preferably all column and column types.

  • Jamie Deakin
    Jamie Deakin almost 12 years
    Yeah that worked for me, but don't forget to refresh the tables in the Object tab after you select the table from the catalog.
  • bbarke
    bbarke about 10 years
    This worked for me as well... Wow it took way to long to find out this was the problem I was seeing...
  • Steven Byks
    Steven Byks about 7 years
    OMG THANK YOU! I've been having issues with this for quite a while now, and just couldn't figure it out. Did something change in a recent update? I feel like it used to just work, like maybe the catalog was selected automatically when you clicked on the schema in tree view? Idk, but this post was exactly what I've been looking for! :-)
  • Mahender Reddy Yasa
    Mahender Reddy Yasa over 5 years
    Thanks @RJ this worked for me..May I know how to change default catalog to other on load(means by default)?..because I'm seeing all schema of default catalog not others