21

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.

Raidri
  • 17,258
  • 9
  • 62
  • 65
Jonas
  • 121,568
  • 97
  • 310
  • 388

4 Answers4

35

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.

Karthic Raghupathi
  • 2,011
  • 5
  • 41
  • 57
  • 1
    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. – leeand00 Jun 13 '12 at 16:24
  • 2
    This worked for me as well... Wow it took way to long to find out this was the problem I was seeing... – bbarke Apr 25 '14 at 07:48
  • 1
    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! :-) – Steven Byks Mar 30 '17 at 14:18
11

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?

kc2001
  • 5,008
  • 4
  • 51
  • 92
8

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
Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
RJ.
  • 313
  • 2
  • 5
  • 14
  • 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 – Mahender Reddy Yasa Oct 03 '18 at 11:27
0

We had this issue using SQuirreL SQL Client with Amazon Redshift PostgreSQL.

A short-term solution just was to use:

SELECT * FROM information_schema.columns

RJ.'s solution worked for some machines (thanks) and not others

In the end we realized it was a driver issue. We needed postgresql-8.4-...jar from http://jdbc.postgresql.org/download.html#others

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
denhams
  • 9
  • 1