SQLM menu option 3 allows you to view (but not alter) privilege grants, primary keys, foreign keys, column definitions and index definitions for a specified table. The procedure that allows you to view these parameters is as follows:
Select option 3 from the SQLM main menu. You will be prompted:
Define Tablename to be Processed.... Enter Tablename :
Enter the name of the SQL table that you wish to
view. If you enter ?
, a list of tables is displayed, from which you can
select. See Using the SQLM Menu Options.
An SQL Table Definitions Menu is displayed, similar to the following:
SQL TABLE DEFINITIONS MENU FOR TABLE 'GUESTS' ============================================== 1. View privilege grants 2. View primary keys 3. View foreign keys 4. View column definitions 5. View index definitions Enter Selection (1 - 5 / null) :
Enter the number of the option you require or press RETURN to exit and return to the main menu.
Menu option 1 on the SQL Table Definitions Menu lists the access privileges granted for the specified table. For example:
Current Grants for Table 'GUESTS' ================================= User_ID / ~Security_Profile ...... Grants ............................... JSMITH Owner PUBLIC None Enter <CR> to continue :
Note that security profiles are preceded by ‘~‘.
Menu option 2 on the SQL Table Definitions Menu lists the primary keys that have been defined for the selected table. For example:
Primary Keys Currently Defined for Table 'GUESTS' ================================================= ROOM Enter <CR> to continue :
Selecting menu option 3 from the SQL Table Definitions Menu displays the message:
No Foreign Keys defined. Enter <CR>:
Note: Foreign keys are not currently supported by SQL for Reality.
Selecting menu option 4 from the SQL Table Definitions Menu lists the column names that are defined for the specified table name. For example:
Columns Currently Defined for Table 'GUESTS' =========================================== 1. ROOM 2. NAME 3. ADDRESS 4. CITY 5. STATE 6. ZIP Enter column# for detail or <CR> to leave :
If there are more items than can be displayed on a single screen, the prompt at the bottom of the screen will be:
Enter column# for detail or <CR> to leave : OR Enter (F)orward (B)ackward to page.
Enter F
to display
the next page, or B
to display the previous page.
Entering a column number displays a column definition screen similar to that shown below.
SQL COLUMN DEFINITION SCREEN FOR Column 'ADDRESS', Table 'GUESTS' ================================================================= 1. Column Name : ADDRESS 2. Column Type : 12 VARCHAR 3. Precision : 20 4. Scale : 5. Attribute Number : 4 6. Multivalue : 1 7. Subvalue : 1 8. Data Generation : 9. Output Format : 10. Input Processing : = 11. Update Processing : = 12. Maximum Header Length : 20 13. Nullable (Y/N) : N 14. Primary Key (Y/N) : N 15. Unique : N 16. Special NULL Handling : N 17. Remarks : Enter <CR> to leave :
Pressing any key returns you to the list of columns.
Notes:
Selecting menu option 5 on the SQL Table Definitions Menu lists the indexes associated with the selected table name. For example:
Indexes Currently Defined for Table 'GUESTS' ============================================ 1. GUEST_DATE 2. GUEST_NAME 3. IID Enter column# for detail or <CR> to leave :
Entering an index number displays an index definition screen similar to that shown below. Then, pressing any key returns you back to the list of columns.
SQL INDEX DEFINITION SCREEN FOR Index 'GUEST_NAME', Table 'GUESTS' ================================================================== 1. Index Name : GUEST_NAME 2. Created by SQL (Y/N) : N 3. Index Type : 3 SORTED INDEX 4. Allow Duplicates (Y/N) : N 5. Column Name(s) : LAST-NAME 6. Collation(s) : A 7. Reality Index Name : GUEST.NAME Enter <CR> to leave :
Note: Refer to SQL Column and Index Definitions for a description of SQL index definition fields.