I need to know the SQL to;

Each of your questions can be answered in two ways — using SQL or using R:Base 
specific commands
 
1.       List all of the tables within the database


LIST TABLES will list all the tables in your database.
LIST VIEWS will list all the views.
LIST will last all the relations (tables and views) except for "system" tables.

SELECT * FROM SYS_TABLES is the SQL meta approach to getting this information.  
SYS_TABLES is not a real table in the database, but is generated to give you an 
SQL window into the databas structure.

2.       List all of the columns within a particular table

LIST <<TableName>> will list the structure of the table <<TableName>> including 
all columns and their definitions (some other information too — indexing, etc)

To use SQL to do this, you first need to look at the SYS_TABLES table to 
extract the SYS_TABLE_ID for the table, then do:

SELECT * FROM SYS_COLUMNS WHERE SYS_TABLE_ID = <<Value Here>>

3.       List a particular column type and length
 
LIST COLUMN <<ColName>> will list all the tables containing the named column, 
plus the structure.

--
Larry

Reply via email to