Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

show tables using sql92

Posted on 2003-10-29
4
Medium Priority
?
422 Views
Last Modified: 2008-02-01

Am running frontbase on linux, and am using the command line tool sql92.

Can connect to a database using...

sql92#7> connect to testdb user _system;

how do i interigate the database so that i can get a list of the tables in that datbase.

Any ideas?
0
Comment
Question by:toakeley
2 Comments
 
LVL 35

Accepted Solution

by:
David Todd earned 252 total points
ID: 9649000
Hi,

Try

select *
from information_schema.tables

SQL Server Books on Line lists this as part of SQL-92 standard.

Regards
  David
0
 
LVL 4

Assisted Solution

by:vk33
vk33 earned 248 total points
ID: 9649669
Hi!

An extract from SQL-92 specification:

         CREATE VIEW TABLES
              AS SELECT
                TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE
              FROM DEFINITION_SCHEMA.TABLES
                  WHERE ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME )
                    IN (
                        SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
                         FROM DEFINITION_SCHEMA.TABLE_PRIVILEGES
                           WHERE GRANTEE IN ( 'PUBLIC', CURRENT_USER )
                        UNION
                        SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
                         FROM DEFINITION_SCHEMA.COLUMN_PRIVILEGES
                           WHERE GRANTEE IN ( 'PUBLIC', CURRENT_USER ) )
                  AND TABLE_CATALOG
                    = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_
              CATALOG_NAME )

You can see the full document here (it's quite large!):

http://luuk.xs4all.nl/sql/sql1992.txt

Regards!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question