Oracle’s sqlplus “show tables” command?

Guess who can never remember how to do the equivalent of “show tables” in Oracle’s SQL*Plus? That’s right: Me. There’s no shorthand for it. You have to use a query like this one:

    select object_name from user_objects;

The user_objects table holds more than just table names, however. So you might want to limit the results to tables. Like this:

    select object_name from user_objects where object_type = 'TABLE';

Some of the types that you my filter on are TABLE, INDEX, SEQUENCE, and FUNCTION. And yep, those are all uppercase, and you’ll have to type ’em in that way if you want it to match on most servers.


Leave a Reply

Your email address will not be published. Required fields are marked *