SQL catalog reporting and querying: Difference between revisions
(Created page with "To review the current contents of the SQL catalog you can query the catalog directly or you can use CCACATREPT, the SQL catalog reporting utility. This topic describes CCACATR...") |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 19: | Line 19: | ||
</ul> | </ul> | ||
As an Application Subsystem utility, CCACATREPT is subject to typical Application Subsystem security, as described in [[System requirements for Application Subsystems]]. | As an Application Subsystem utility, CCACATREPT is subject to typical Application Subsystem security, as described in [[System requirements for Application Subsystems]]. This is the case whether you are accessing CCACATREPT directly from your Model 204 command line as described on this page, or whether you are accessing from the [[RKTools#mainmenu|RKTools main menu]] or the [[RKWeb]] interface. RKWeb uses [[Janus Web Legacy Support]] to serve facsimiles of the screens described on this page. | ||
===Logging in=== | ===Logging in=== | ||
Before you can log in to CCACATREPT, the CCACATREPT subsystem must already have been started with the Model 204 <var>START SUBSYSTEM</var> command. If you access CCACATREPT from the RKWeb interface, this command is probably already issued as part of the [[RKTools installation#Janus Web rules for RKWeb|recommended set up for RKWeb]]. | |||
To log in to CCACATREPT, at your Model 204 Online prompt enter <code><b>CCACATREPT</b></code> and press Enter. | |||
To log in to CCACATREPT, at your Model 204 Online prompt enter <code><b>CCACATREPT</b></code> and press Enter. | |||
The CCACATREPT Main Menu is displayed. | The CCACATREPT Main Menu is displayed. | ||
Line 40: | Line 39: | ||
After you make final panel field selections and generate a report, CCACATREPT redisplays the panel with those selections. | After you make final panel field selections and generate a report, CCACATREPT redisplays the panel with those selections. | ||
You can enter an asterisk (*) in an input area to select all the items of a particular category. | You can enter an asterisk (<tt>*</tt>) in an input area to select all the items of a particular category. | ||
The command line (===>) is at the bottom of the panel. Use the command line to enter commands in lieu of PF keys. The minimum abbreviation for a command is generally the first three characters, for example, REF for REFresh. The minimum abbreviation appears in capital letters in the PF key display area. | The command line (===>) is at the bottom of the panel. Use the command line to enter commands in lieu of PF keys. The minimum abbreviation for a command is generally the first three characters, for example, <code>REF</code> for <b>REFresh</b>. The minimum abbreviation appears in capital letters in the PF key display area. | ||
The PF keys of the CCACATREPT main menu are described in the following table. | The PF keys of the CCACATREPT main menu are described in the following table. In the RKWeb display, comparable buttons replace the PF keys. | ||
<table> | <table> | ||
<p class="caption">CCACATREPT main menu PF keys</p> | <p class="caption">CCACATREPT main menu PF keys</p> | ||
<tr> | <tr class="head"> | ||
<th>Key</th> | <th>Key</th> | ||
<th>Explanation</th> | <th>Explanation</th> | ||
Line 104: | Line 103: | ||
You must specify an entry in this field if you entered 1 in the Selection field. The output from Selection 1 is standard SQL DDL generated from the Model 204 SQL catalog. In the DDL Statement Type(s) field, you identify the DDL statement types to be generated. | You must specify an entry in this field if you entered 1 in the Selection field. The output from Selection 1 is standard SQL DDL generated from the Model 204 SQL catalog. In the DDL Statement Type(s) field, you identify the DDL statement types to be generated. | ||
Select one or more of the following identifiers: | |||
<table> | <table> | ||
<tr> | <tr class="head"> | ||
<th>Identifier</th> | <th>Identifier</th> | ||
<th>Statement generated</th> | <th>Statement generated</th> | ||
Line 154: | Line 153: | ||
The first reporting option on the Main Menu is to generate the SQL DDL from the existing SQL catalog (CCACAT file) data. This DDL is output in valid SQL syntax that you can use to rebuild the catalog. You can also use it to report the existing catalog data in a standard format familiar to SQL users.</p> | The first reporting option on the Main Menu is to generate the SQL DDL from the existing SQL catalog (CCACAT file) data. This DDL is output in valid SQL syntax that you can use to rebuild the catalog. You can also use it to report the existing catalog data in a standard format familiar to SQL users.</p> | ||
<p class="note"><b>Note:</b> Currently the CCACATREPT subsystem does not generate DDL statement delimiters. However, semicolons are required by the CVI utility. You can add delimiters by hand or use another SQL utility that does not require DDL delimiters. The Connect<span class="superstar">★</span> ODBC unsupported utilities, DDLWIN and CLIIVP, are examples of utilities which accept DDL input lines without delimiters.</p> | <p class="note"><b>Note:</b> Currently the CCACATREPT subsystem does not generate DDL statement delimiters. However, semicolons are required by the CVI utility. You can add delimiters by hand or use another SQL utility that does not require DDL delimiters. The [[Connect*_for_ODBC|Connect<span class="superstar">★</span> for ODBC]] unsupported utilities, DDLWIN and CLIIVP, are examples of utilities which accept DDL input lines without delimiters.</p> | ||
===Specifying report input parameters=== | ===Specifying report input parameters=== | ||
The required input parameters are described in the following table. | The required input parameters are described in the following table. | ||
<table> | <table> | ||
<tr> | <tr class="head"> | ||
<th>Required parameter</th> | <th>Required parameter</th> | ||
<th>Enter...</th> | <th>Enter...</th> | ||
Line 166: | Line 164: | ||
<tr> | <tr> | ||
<td>Schema Name</td> | <td>Schema Name</td> | ||
<td>Specific name or | <td>Specific name, or asterisk (<tt>*</tt>)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Authorization ID </td> | <td>Authorization ID </td> | ||
<td>Specific ID or | <td>Specific ID, or asterisk (<tt>*</tt>)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Table/View Name</td> | <td>Table/View Name</td> | ||
<td>Specific name or | <td>Specific name, or asterisk (<tt>*</tt>)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 297: | Line 295: | ||
Input parameters for the report are: | Input parameters for the report are: | ||
<ul> | <ul> | ||
<li>Specific schema name ( | <li>Specific schema name, or asterisk (<tt>*</tt>)</li> | ||
<li>Specific authorization ID ( | <li>Specific authorization ID, or asterisk (<tt>*</tt>)</li> | ||
<li>Specific table or view name ( | <li>Specific table or view name, or asterisk (<tt>*</tt>)</li> | ||
</ul> | </ul> | ||
===Contents of the report=== | ===Contents of the report=== | ||
The report provides the following information for tables (see [[#Sample report|Sample report]]): | The report provides the following information for tables (see [[#Sample report|Sample report]]): | ||
<ul> | <ul> | ||
Line 369: | Line 366: | ||
Input parameters for the report are: | Input parameters for the report are: | ||
<ul> | <ul> | ||
<li>Specific schema name ( | <li>Specific schema name, or asterisk (<tt>*</tt>)</li> | ||
<li>Specific table or view name ( | <li>Specific table or view name, or asterisk (<tt>*</tt>)</li> | ||
</ul> | </ul> | ||
Line 378: | Line 375: | ||
<p class="caption" style="width:400px">Privilege report by table/view display fields</p> | <p class="caption" style="width:400px">Privilege report by table/view display fields</p> | ||
<table> | <table> | ||
<tr> | <tr class="head"> | ||
<th>Field</th> | <th>Field</th> | ||
<th>Meaning</th> | <th>Meaning</th> | ||
Line 386: | Line 383: | ||
<td>Name of the table or view for which indicated privileges are valid.</td> | <td>Name of the table or view for which indicated privileges are valid.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>GRANTEE</td> | <td>GRANTEE</td> | ||
<td>User ID for which the privileges are granted.</td> | <td>User ID for which the privileges are granted.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SEL</td> | <td>SEL</td> | ||
Line 395: | Line 394: | ||
If blank, no such privilege.</td> | If blank, no such privilege.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>INS</td> | <td>INS</td> | ||
Line 400: | Line 400: | ||
If blank, no such privilege.</td> | If blank, no such privilege.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>DEL</td> | <td>DEL</td> | ||
Line 405: | Line 406: | ||
If blank, no such privilege.</td> | If blank, no such privilege.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>UPD</td> | <td>UPD</td> | ||
Line 410: | Line 412: | ||
If blank, no such privilege.</td> | If blank, no such privilege.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>OPT</td> | <td>OPT</td> | ||
Line 415: | Line 418: | ||
If N, no such privilege.</td> | If N, no such privilege.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN-NAME</td> | <td>COLUMN-NAME</td> | ||
<td>For UPDATE only, specific columns for which the privilege is granted. <br />Asterisk (*) means all columns.</td> | <td>For UPDATE only, specific columns for which the privilege is granted. <br />Asterisk (<tt>*</tt>) means all columns.</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
===Sample Privilege Report by table and view=== | ===Sample Privilege Report by table and view=== | ||
The sample output in the following figure is generated by the following input parameter specifications: | The sample output in the following figure is generated by the following input parameter specifications: | ||
<p class="code">Schema Name = demo | <p class="code">Schema Name = demo | ||
Line 429: | Line 432: | ||
The output is a privilege report for all the tables and views in the DEMO schema. | The output is a privilege report for all the tables and views in the DEMO schema. | ||
<p class="caption" style="width: | <p class="caption" style="width:600px">Sample Privilege Report by table/view</p> | ||
<p class="code">18 NOV 09 SQL PRIVILEGE REPORT -- BY TABLE/VIEW PAGE: 1 | <p class="code">18 NOV 09 SQL PRIVILEGE REPORT -- BY TABLE/VIEW PAGE: 1 | ||
Line 496: | Line 499: | ||
===Report input parameter=== | ===Report input parameter=== | ||
The required input parameter for the report is: Specific grantee (or | The required input parameter for the report is: Specific grantee (or <tt>*</tt>). | ||
===Report display fields=== | ===Report display fields=== | ||
Line 508: | Line 511: | ||
The output is a report of all the privileges granted to USERXXX or to PUBLIC. | The output is a report of all the privileges granted to USERXXX or to PUBLIC. | ||
<p class="caption" style="width: | <p class="caption" style="width:600px">Sample Privilege report by grantee</p> | ||
<p class="code">18 NOV 09 SQL PRIVILEGE REPORT -- BY GRANTEE PAGE: 1 | <p class="code">18 NOV 09 SQL PRIVILEGE REPORT -- BY GRANTEE PAGE: 1 | ||
Line 571: | Line 574: | ||
The CATALOG.TABLES columns (described in [[#TABLES view|TABLES view]]), ordered from left to right, are: | The CATALOG.TABLES columns (described in [[#TABLES view|TABLES view]]), ordered from left to right, are: | ||
<p class="code">TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, FILE_NAME, TABLE_TYPE, COLUMN_CARDINALITY, PRIMARY_KEY, SYSTEM_KEY, PARENT_TABLE_NAME, TIMESTAMP</p> | <p class="code">TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, FILE_NAME, TABLE_TYPE, COLUMN_CARDINALITY, | ||
PRIMARY_KEY, SYSTEM_KEY, PARENT_TABLE_NAME, TIMESTAMP</p> | |||
This is the default display order, which derives from the order of the columns in the individual CATALOG view definition. | This is the default display order, which derives from the order of the columns in the individual CATALOG view definition. | ||
<table class="noBorder"> | <table class="noBorder"> | ||
<caption>SELECT * from CATALOG.TABLES</caption> | |||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 589: | Line 594: | ||
<td><code>19920911000004</code></td> | <td><code>19920911000004</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 601: | Line 607: | ||
<td><code>19920911000007</code></td> | <td><code>19920911000007</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 613: | Line 620: | ||
<td><code>19920911000010</code></td> | <td><code>19920911000010</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 625: | Line 633: | ||
<td><code>19920911000000</code></td> | <td><code>19920911000000</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 637: | Line 646: | ||
<td><code>19920911000016</code></td> | <td><code>19920911000016</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 649: | Line 659: | ||
<td><code>19920911000019</code></td> | <td><code>19920911000019</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 661: | Line 672: | ||
<td><code>19920911000022</code></td> | <td><code>19920911000022</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 673: | Line 685: | ||
<td><code>19920911000025</code></td> | <td><code>19920911000025</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 685: | Line 698: | ||
<td><code>19920911000028</code></td> | <td><code>19920911000028</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 697: | Line 711: | ||
<td><code>19981201142400</code></td> | <td><code>19981201142400</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 709: | Line 724: | ||
<td><code>19981201142400</code></td> | <td><code>19981201142400</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 721: | Line 737: | ||
<td><code>19981201142400</code></td> | <td><code>19981201142400</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 733: | Line 750: | ||
<td><code>19981201142400</code></td> | <td><code>19981201142400</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 745: | Line 763: | ||
<td><code>19981201142400</code></td> | <td><code>19981201142400</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 757: | Line 776: | ||
<td><code>19981201142401</code></td> | <td><code>19981201142401</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 769: | Line 789: | ||
<td><code>19981201142401</code></td> | <td><code>19981201142401</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 781: | Line 802: | ||
<td><code>19981201142401</code></td> | <td><code>19981201142401</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 793: | Line 815: | ||
<td><code>19981201142401</code></td> | <td><code>19981201142401</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 805: | Line 828: | ||
<td><code>19921117183249</code></td> | <td><code>19921117183249</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 817: | Line 841: | ||
<td><code>19921117183250</code></td> | <td><code>19921117183250</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 829: | Line 854: | ||
<td><code>19921117183251</code></td> | <td><code>19921117183251</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 841: | Line 867: | ||
<td><code>19921117183253</code></td> | <td><code>19921117183253</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 853: | Line 880: | ||
<td><code>19921117183254</code></td> | <td><code>19921117183254</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 865: | Line 893: | ||
<td><code>19921117183254</code></td> | <td><code>19921117183254</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 877: | Line 906: | ||
<td><code>19921117183256</code></td> | <td><code>19921117183256</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 906: | Line 936: | ||
<p class="code">SELECT * FROM CATALOG.TABLES WHERE TABLE_SCHEMA='USERXXX' ORDER BY TABLE_SCHEMA, TABLE_NAME</p> | <p class="code">SELECT * FROM CATALOG.TABLES WHERE TABLE_SCHEMA='USERXXX' ORDER BY TABLE_SCHEMA, TABLE_NAME</p> | ||
<table class="noBorder"> | <table class="noBorder"> | ||
<caption>SELECT * with ORDER BY from CATALOG.TABLES</caption> | |||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 920: | Line 950: | ||
<td><code>19921117183253</code></td> | <td><code>19921117183253</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 932: | Line 963: | ||
<td><code>19921117183258</code></td> | <td><code>19921117183258</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 944: | Line 976: | ||
<td><code>19921117183251</code></td> | <td><code>19921117183251</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 956: | Line 989: | ||
<td><code>19921117183249</code></td> | <td><code>19921117183249</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 968: | Line 1,002: | ||
<td><code>19921117183254</code></td> | <td><code>19921117183254</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 980: | Line 1,015: | ||
<td><code>19921117183256</code></td> | <td><code>19921117183256</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 992: | Line 1,028: | ||
<td><code>19921117183250</code></td> | <td><code>19921117183250</code></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><code>CCACAT</code></td> | <td><code>CCACAT</code></td> | ||
Line 1,013: | Line 1,050: | ||
===SCHEMAS view=== | ===SCHEMAS view=== | ||
The following table lists the CATALOG.SCHEMAS view columns and their descriptions. This view contains a row of identifying information for each schema whose authorization ID is your login ID. | The following table lists the CATALOG.SCHEMAS view columns and their descriptions. This view contains a row of identifying information for each schema whose authorization ID is your login ID. | ||
SCHEMATA is an alias for SCHEMAS. You can query either SCHEMAS or SCHEMATA. | SCHEMATA is an alias for SCHEMAS. You can query either SCHEMAS or SCHEMATA. | ||
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT * query against the view. | The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified <code>SELECT *</code> query against the view. | ||
<table> | <table> | ||
<tr> | <caption>SCHEMAS view columns</caption> | ||
<tr class="head"> | |||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SCHEMA_CATALOG</td> | <td>SCHEMA_CATALOG</td> | ||
Line 1,031: | Line 1,069: | ||
<td>Name of the catalog where the schema is cataloged (CCACAT)</td> | <td>Name of the catalog where the schema is cataloged (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SCHEMA_NAME</td> | <td>SCHEMA_NAME</td> | ||
Line 1,036: | Line 1,075: | ||
<td>Name of the schema</td> | <td>Name of the schema</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SCHEMA_OWNER</td> | <td>SCHEMA_OWNER</td> | ||
Line 1,041: | Line 1,081: | ||
<td>Authorization ID of the owner of the schema</td> | <td>Authorization ID of the owner of the schema</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TIMESTAMP</td> | <td>TIMESTAMP</td> | ||
Line 1,048: | Line 1,089: | ||
===TABLES view=== | ===TABLES view=== | ||
The following table lists the CATALOG.TABLES view columns and their descriptions. This view contains a row of descriptive information for each table or view you have the authority to access. | The following table lists the CATALOG.TABLES view columns and their descriptions. This view contains a row of descriptive information for each table or view you have the authority to access. | ||
<p> | <p> | ||
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT * query against the view.</p> | The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified <code>SELECT *</code> query against the view.</p> | ||
<table> | <table> | ||
<tr> | <caption>TABLES view columns</caption> | ||
<tr class="head"> | |||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_CATALOG</td> | <td>TABLE_CATALOG</td> | ||
Line 1,064: | Line 1,106: | ||
<td>Name of the catalog in which the table is cataloged (CCACAT)</td> | <td>Name of the catalog in which the table is cataloged (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_SCHEMA</td> | <td>TABLE_SCHEMA</td> | ||
Line 1,069: | Line 1,112: | ||
<td>Name of the schema to which the table belongs</td> | <td>Name of the schema to which the table belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,074: | Line 1,118: | ||
<td>Name of the table</td> | <td>Name of the table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>FILE_NAME</td> | <td>FILE_NAME</td> | ||
Line 1,079: | Line 1,124: | ||
<td>Name of the Model 204 file to which the table maps</td> | <td>Name of the Model 204 file to which the table maps</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_TYPE</td> | <td>TABLE_TYPE</td> | ||
Line 1,084: | Line 1,130: | ||
<td>Type of table: either T (table), or V (view)</td> | <td>Type of table: either T (table), or V (view)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN_CARDINALITY</td> | <td>COLUMN_CARDINALITY</td> | ||
Line 1,089: | Line 1,136: | ||
<td>Number of columns defined in the table being described</td> | <td>Number of columns defined in the table being described</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PRIMARY_KEY</td> | <td>PRIMARY_KEY</td> | ||
Line 1,094: | Line 1,142: | ||
<td>Name of any primary or nested key column; otherwise, null</td> | <td>Name of any primary or nested key column; otherwise, null</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SYSTEM_KEY</td> | <td>SYSTEM_KEY</td> | ||
Line 1,101: | Line 1,150: | ||
<p>null if there is no primary or nested key </p></td> | <p>null if there is no primary or nested key </p></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PARENT_TABLE_NAME</td> | <td>PARENT_TABLE_NAME</td> | ||
Line 1,106: | Line 1,156: | ||
<td>Name of parent table if the table is nested; otherwise, null</td> | <td>Name of parent table if the table is nested; otherwise, null</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TIMESTAMP</td> | <td>TIMESTAMP</td> | ||
Line 1,117: | Line 1,168: | ||
The following table lists the CATALOG.TABLE_COLUMNS view columns and their descriptions. This view contains a row of column definition information for each column in each base or nested table you have the authority to access. The TABLE_COLUMNS view contains column definition information not contained in the COLUMNS view, for example, the name of the Model 204 field to which the column maps.</p> | The following table lists the CATALOG.TABLE_COLUMNS view columns and their descriptions. This view contains a row of column definition information for each column in each base or nested table you have the authority to access. The TABLE_COLUMNS view contains column definition information not contained in the COLUMNS view, for example, the name of the Model 204 field to which the column maps.</p> | ||
<p> | <p> | ||
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT * query against the view.</p> | The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified <code>SELECT *</code> query against the view.</p> | ||
< | <table class="head"> | ||
<caption>TABLE_COLUMNS view columns</caption> | |||
<tr> | <tr> | ||
<th>Column name</th> | <th>Column name</th> | ||
Line 1,126: | Line 1,177: | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_CATALOG</td> | <td>TABLE_CATALOG</td> | ||
Line 1,131: | Line 1,183: | ||
<td>Name of the catalog in which the table is cataloged (CCACAT)</td> | <td>Name of the catalog in which the table is cataloged (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_SCHEMA</td> | <td>TABLE_SCHEMA</td> | ||
Line 1,136: | Line 1,189: | ||
<td>Name of the schema to which the table belongs</td> | <td>Name of the schema to which the table belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,141: | Line 1,195: | ||
<td>Name of the table</td> | <td>Name of the table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN_NAME</td> | <td>COLUMN_NAME</td> | ||
Line 1,146: | Line 1,201: | ||
<td>Name of the column</td> | <td>Name of the column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>FIELD_NAME</td> | <td>FIELD_NAME</td> | ||
Line 1,151: | Line 1,207: | ||
<td>Name of the Model 204 field to which the column maps</td> | <td>Name of the Model 204 field to which the column maps</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NUMERIC_PRECISION</td> | <td>NUMERIC_PRECISION</td> | ||
Line 1,156: | Line 1,213: | ||
<td>Maximum numeric precision of the column values</td> | <td>Maximum numeric precision of the column values</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NUMERIC_SCALE</td> | <td>NUMERIC_SCALE</td> | ||
Line 1,161: | Line 1,219: | ||
<td>Numeric scale of the column values</td> | <td>Numeric scale of the column values</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CHAR_MAX_LENGTH</td> | <td>CHAR_MAX_LENGTH</td> | ||
Line 1,166: | Line 1,225: | ||
<td>Maximum length of string values, if the column data type is CHAR; otherwise, zero</td> | <td>Maximum length of string values, if the column data type is CHAR; otherwise, zero</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>DATA_TYPE</td> | <td>DATA_TYPE</td> | ||
Line 1,171: | Line 1,231: | ||
<td>SQL data type of the column (not the Model 204 field attribute)</td> | <td>SQL data type of the column (not the Model 204 field attribute)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NULL_ALLOWED</td> | <td>NULL_ALLOWED</td> | ||
Line 1,176: | Line 1,237: | ||
<td>1, if NULL values are allowed for the column; otherwise, 0</td> | <td>1, if NULL values are allowed for the column; otherwise, 0</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COL_UNIQUE</td> | <td>COL_UNIQUE</td> | ||
Line 1,189: | Line 1,251: | ||
Column information for views is limited to the column name. For more view column attribute information, query the TABLE_COLUMNS view for the base tables referenced in the view definition FROM clause.</p> | Column information for views is limited to the column name. For more view column attribute information, query the TABLE_COLUMNS view for the base tables referenced in the view definition FROM clause.</p> | ||
<p> | <p> | ||
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT * query against the view.</p> | The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified <code>SELECT *</code> query against the view.</p> | ||
<table> | <table> | ||
< | <caption>COLUMNS view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_CATALOG</td> | <td>TABLE_CATALOG</td> | ||
Line 1,202: | Line 1,266: | ||
<td>Name of the catalog in which the column's table is cataloged (CCACAT)</td> | <td>Name of the catalog in which the column's table is cataloged (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_SCHEMA</td> | <td>TABLE_SCHEMA</td> | ||
Line 1,207: | Line 1,272: | ||
<td>Name of the schema to which the column's table or view belongs</td> | <td>Name of the schema to which the column's table or view belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,212: | Line 1,278: | ||
<td>Name of the column's table or view</td> | <td>Name of the column's table or view</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN_NAME</td> | <td>COLUMN_NAME</td> | ||
Line 1,217: | Line 1,284: | ||
<td>Name of the column</td> | <td>Name of the column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NUMERIC_PRECISION</td> | <td>NUMERIC_PRECISION</td> | ||
Line 1,224: | Line 1,292: | ||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NUMERIC_SCALE</td> | <td>NUMERIC_SCALE</td> | ||
Line 1,231: | Line 1,300: | ||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CHAR_MAX_LENGTH</td> | <td>CHAR_MAX_LENGTH</td> | ||
Line 1,237: | Line 1,307: | ||
View columns: 0 (not stored)</td> | View columns: 0 (not stored)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>DATA_TYPE</td> | <td>DATA_TYPE</td> | ||
Line 1,253: | Line 1,324: | ||
If a view definition has more than 255 characters, it is continued in the VIEW_DEFINITION column on one or more additional rows. Except for the view definition, the column values in these extra rows duplicate those in the row with the beginning of the view definition. </p> | If a view definition has more than 255 characters, it is continued in the VIEW_DEFINITION column on one or more additional rows. Except for the view definition, the column values in these extra rows duplicate those in the row with the beginning of the view definition. </p> | ||
<p> | <p> | ||
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT * query against the view. </p> | The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified <code>SELECT *</code> query against the view. </p> | ||
<table> | <table> | ||
< | <caption>VIEWS view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_CATALOG</td> | <td>TABLE_CATALOG</td> | ||
Line 1,266: | Line 1,338: | ||
<td>Name of the catalog in which the view is cataloged (CCACAT)</td> | <td>Name of the catalog in which the view is cataloged (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_SCHEMA</td> | <td>TABLE_SCHEMA</td> | ||
Line 1,271: | Line 1,344: | ||
<td>Name of the schema to which the view belongs</td> | <td>Name of the schema to which the view belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,276: | Line 1,350: | ||
<td>Name of the view</td> | <td>Name of the view</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>VIEW_DEFINITION</td> | <td>VIEW_DEFINITION</td> | ||
Line 1,282: | Line 1,357: | ||
You might want to include TABLE_SCHEMA and TABLE_NAME in your query to help identify the view definition output.</td> | You might want to include TABLE_SCHEMA and TABLE_NAME in your query to help identify the view definition output.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CHECK_OPTION</td> | <td>CHECK_OPTION</td> | ||
Line 1,287: | Line 1,363: | ||
<td>1, if WITH CHECK OPTION clause is present in the view definition; otherwise, 0</td> | <td>1, if WITH CHECK OPTION clause is present in the view definition; otherwise, 0</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>UPDATABLE</td> | <td>UPDATABLE</td> | ||
Line 1,300: | Line 1,377: | ||
This view displays only multi-column unique constraints; primary key and foreign key constraints are not displayed. The names of the columns participating in each multi-column unique key are displayed in the KEY_COLUMN_USAGE view. </p> | This view displays only multi-column unique constraints; primary key and foreign key constraints are not displayed. The names of the columns participating in each multi-column unique key are displayed in the KEY_COLUMN_USAGE view. </p> | ||
<p> | <p> | ||
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT * query against the view. </p> | The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified <code>SELECT *</code> query against the view. </p> | ||
<table> | <table> | ||
< | <caption>TABLE_CONSTRAINTS view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CONSTRAINT_CATALOG</td> | <td>CONSTRAINT_CATALOG</td> | ||
Line 1,313: | Line 1,391: | ||
<td>Name of the catalog in which the constraint table is cataloged (CCACAT)</td> | <td>Name of the catalog in which the constraint table is cataloged (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CONSTRAINT_SCHEMA</td> | <td>CONSTRAINT_SCHEMA</td> | ||
Line 1,318: | Line 1,397: | ||
<td>Name of the schema to which the constraint table belongs</td> | <td>Name of the schema to which the constraint table belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,323: | Line 1,403: | ||
<td>Name of the table in which the constraint was defined</td> | <td>Name of the table in which the constraint was defined</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CONSTRAINT_FIELD</td> | <td>CONSTRAINT_FIELD</td> | ||
Line 1,328: | Line 1,409: | ||
<td>Name of the UNIQUE Model 204 field that is used to generate the Model 204 index and constraints</td> | <td>Name of the UNIQUE Model 204 field that is used to generate the Model 204 index and constraints</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CONSTRAINT_TYPE</td> | <td>CONSTRAINT_TYPE</td> | ||
Line 1,333: | Line 1,415: | ||
<td>U, for unique</td> | <td>U, for unique</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TIMESTAMP</td> | <td>TIMESTAMP</td> | ||
Line 1,346: | Line 1,429: | ||
This view is only for columns that participate in multicolumn unique constraints; primary key and foreign key constraints are not displayed. </p> | This view is only for columns that participate in multicolumn unique constraints; primary key and foreign key constraints are not displayed. </p> | ||
<p> | <p> | ||
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT * query against the view. </p> | The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified <code>SELECT *</code> query against the view. </p> | ||
<table> | <table> | ||
< | <caption>KEY_COLUMN_USAGE view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CONSTRAINT_CATALOG</td> | <td>CONSTRAINT_CATALOG</td> | ||
Line 1,359: | Line 1,443: | ||
<td>Name of the catalog in which the constraint table is cataloged (CCACAT)</td> | <td>Name of the catalog in which the constraint table is cataloged (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CONSTRAINT_SCHEMA</td> | <td>CONSTRAINT_SCHEMA</td> | ||
<td nowrap>CHAR(18)</td> | <td nowrap>CHAR(18)</td> | ||
<td>Name of the schema to which the constraint table belongs</tr> | <td>Name of the schema to which the constraint table belongs</tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,368: | Line 1,454: | ||
<td>Name of the table in which the constraint is defined</td> | <td>Name of the table in which the constraint is defined</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CONSTRAINT_FIELD</td> | <td>CONSTRAINT_FIELD</td> | ||
Line 1,373: | Line 1,460: | ||
<td>Name of the UNIQUE Model 204 field that is used to generate Model 204 index and constraints</td> | <td>Name of the UNIQUE Model 204 field that is used to generate Model 204 index and constraints</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN_NAME</td> | <td>COLUMN_NAME</td> | ||
Line 1,384: | Line 1,472: | ||
The following table lists the CATALOG.TABLE_PRIVILEGES view columns and their descriptions. The TABLE_PRIVILEGES view contains a row for each table and view for which you have or have granted a DML update privilege.</p> | The following table lists the CATALOG.TABLE_PRIVILEGES view columns and their descriptions. The TABLE_PRIVILEGES view contains a row for each table and view for which you have or have granted a DML update privilege.</p> | ||
<p> | <p> | ||
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT * query against the view. </p> | The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified <code>SELECT *</code> query against the view. </p> | ||
<table> | <table> | ||
< | <caption>TABLE_PRIVILEGES view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>GRANTOR</td> | <td>GRANTOR</td> | ||
Line 1,397: | Line 1,486: | ||
<td>Authorization ID of the user giving the privilege</td> | <td>Authorization ID of the user giving the privilege</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>GRANTEE</td> | <td>GRANTEE</td> | ||
Line 1,402: | Line 1,492: | ||
<td>Authorization ID, which may be PUBLIC (all users), of the user given the privilege</td> | <td>Authorization ID, which may be PUBLIC (all users), of the user given the privilege</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_CATALOG</td> | <td>TABLE_CATALOG</td> | ||
Line 1,407: | Line 1,498: | ||
<td>Name of the catalog in which the table or view is cataloged (CCACAT)</td> | <td>Name of the catalog in which the table or view is cataloged (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_SCHEMA</td> | <td>TABLE_SCHEMA</td> | ||
Line 1,412: | Line 1,504: | ||
<td>Name of the schema to which the table or view belongs</td> | <td>Name of the schema to which the table or view belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,417: | Line 1,510: | ||
<td>Name of the table or view</td> | <td>Name of the table or view</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PRIVILEGE</td> | <td>PRIVILEGE</td> | ||
Line 1,422: | Line 1,516: | ||
<td>Type of privilege: SELECT, INSERT, DELETE, or UPDATE</td> | <td>Type of privilege: SELECT, INSERT, DELETE, or UPDATE</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>GRANTABLE</td> | <td>GRANTABLE</td> | ||
Line 1,427: | Line 1,522: | ||
<td>1, if the privilege includes WITH GRANT OPTION; otherwise, 0</td> | <td>1, if the privilege includes WITH GRANT OPTION; otherwise, 0</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TIMESTAMP</td> | <td>TIMESTAMP</td> | ||
Line 1,438: | Line 1,534: | ||
The following table lists the CATALOG.COLUMN_PRIVILEGES view columns and their descriptions. The COLUMN_PRIVILEGES view contains a row for each DML update privilege you have or have granted for a column. </p> | The following table lists the CATALOG.COLUMN_PRIVILEGES view columns and their descriptions. The COLUMN_PRIVILEGES view contains a row for each DML update privilege you have or have granted for a column. </p> | ||
<p> | <p> | ||
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT * query against the view. </p> | The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified <code>SELECT *</code> query against the view. </p> | ||
<table> | <table> | ||
< | <caption>COLUMN_PRIVILEGES view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>GRANTOR</td> | <td>GRANTOR</td> | ||
Line 1,451: | Line 1,548: | ||
<td>Authorization ID of the user giving the privilege</td> | <td>Authorization ID of the user giving the privilege</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>GRANTEE</td> | <td>GRANTEE</td> | ||
Line 1,456: | Line 1,554: | ||
<td>Authorization ID, which may be PUBLIC (all users), of the user given the privilege</td> | <td>Authorization ID, which may be PUBLIC (all users), of the user given the privilege</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_CATALOG</td> | <td>TABLE_CATALOG</td> | ||
Line 1,461: | Line 1,560: | ||
<td>Name of the catalog in which the table or view is cataloged (CCACAT)</td> | <td>Name of the catalog in which the table or view is cataloged (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_SCHEMA</td> | <td>TABLE_SCHEMA</td> | ||
Line 1,466: | Line 1,566: | ||
<td>Name of the schema to which the table or view belongs</td> | <td>Name of the schema to which the table or view belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,471: | Line 1,572: | ||
<td>Name of the table or view</td> | <td>Name of the table or view</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN_NAME</td> | <td>COLUMN_NAME</td> | ||
Line 1,476: | Line 1,578: | ||
<td>Name of a column from the list of columns for which update privilege is granted; one row is returned for each such column </td> | <td>Name of a column from the list of columns for which update privilege is granted; one row is returned for each such column </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PRIVILEGE</td> | <td>PRIVILEGE</td> | ||
Line 1,481: | Line 1,584: | ||
<td>Type of privilege: SELECT, INSERT, DELETE, or UPDATE</td> | <td>Type of privilege: SELECT, INSERT, DELETE, or UPDATE</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>GRANTABLE</td> | <td>GRANTABLE</td> | ||
Line 1,486: | Line 1,590: | ||
<td>1, if the privilege includes WITH GRANT OPTION; otherwise, 0</td> | <td>1, if the privilege includes WITH GRANT OPTION; otherwise, 0</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TIMESTAMP</td> | <td>TIMESTAMP</td> | ||
Line 1,497: | Line 1,602: | ||
The following table lists the CATALOG.ODBC_TYPES and their descriptions. The ODBC_TYPES view contains a row of information for each discrete data type supported by the Connect<span class="superstar">★</span> drivers.</p> | The following table lists the CATALOG.ODBC_TYPES and their descriptions. The ODBC_TYPES view contains a row of information for each discrete data type supported by the Connect<span class="superstar">★</span> drivers.</p> | ||
<table> | <table> | ||
< | <caption>ODBC_TYPES view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TYPE_NAME</td> | <td>TYPE_NAME</td> | ||
Line 1,508: | Line 1,614: | ||
<td>Name of a data type that can be used for defining columns to be accessed through ODBC</td> | <td>Name of a data type that can be used for defining columns to be accessed through ODBC</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>DATA_TYPE</td> | <td>DATA_TYPE</td> | ||
Line 1,513: | Line 1,620: | ||
<td>Data type code number for the data type, as specified in the ODBC API</td> | <td>Data type code number for the data type, as specified in the ODBC API</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PRECISION_VAL</td> | <td>PRECISION_VAL</td> | ||
Line 1,518: | Line 1,626: | ||
<td>Maximum precision for this data type. 0 is returned, if precision is not applicable</td> | <td>Maximum precision for this data type. 0 is returned, if precision is not applicable</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>LITERAL_PREFIX</td> | <td>LITERAL_PREFIX</td> | ||
Line 1,523: | Line 1,632: | ||
<td>Character used to prefix a literal. For example, a single quotation mark (') is used for CHAR data type literals</td> | <td>Character used to prefix a literal. For example, a single quotation mark (') is used for CHAR data type literals</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>LITERAL_SUFFIX</td> | <td>LITERAL_SUFFIX</td> | ||
Line 1,528: | Line 1,638: | ||
<td>Character used to terminate a literal, for example, a single quotation mark (') is used to terminal a CHAR data type literal</td> | <td>Character used to terminate a literal, for example, a single quotation mark (') is used to terminal a CHAR data type literal</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CREATE_PARAMS</td> | <td>CREATE_PARAMS</td> | ||
Line 1,533: | Line 1,644: | ||
<td>Description of the creation parameters for this data type. For example, LENGTH is specified for a CHAR data type</td> | <td>Description of the creation parameters for this data type. For example, LENGTH is specified for a CHAR data type</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NULLABLE</td> | <td>NULLABLE</td> | ||
Line 1,540: | Line 1,652: | ||
0 means null not allowed</td> | 0 means null not allowed</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CASE_SENSITIVE</td> | <td>CASE_SENSITIVE</td> | ||
Line 1,546: | Line 1,659: | ||
0 means they are not</td> | 0 means they are not</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SEARCHABLE</td> | <td>SEARCHABLE</td> | ||
Line 1,552: | Line 1,666: | ||
3 means they can be used also with LIKE</td> | 3 means they can be used also with LIKE</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>UNSIGNED_ATTRIBUTE</td> | <td>UNSIGNED_ATTRIBUTE</td> | ||
Line 1,557: | Line 1,672: | ||
<td>1 means the data type is unsigned; 0 means it is signed</td> | <td>1 means the data type is unsigned; 0 means it is signed</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>MONEY</td> | <td>MONEY</td> | ||
Line 1,562: | Line 1,678: | ||
<td>1 means a monetary data type; 0 means it is not</td> | <td>1 means a monetary data type; 0 means it is not</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>AUTO_INCREMENT</td> | <td>AUTO_INCREMENT</td> | ||
Line 1,568: | Line 1,685: | ||
0 means they are not automatically incremented</td> | 0 means they are not automatically incremented</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>LOCAL_TYPE_NAME</td> | <td>LOCAL_TYPE_NAME</td> | ||
Line 1,573: | Line 1,691: | ||
<td>Localized name for this data type on this data source that is different from the standard data type name</td> | <td>Localized name for this data type on this data source that is different from the standard data type name</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>RADIX</td> | <td>RADIX</td> | ||
Line 1,578: | Line 1,697: | ||
<td>Number base used for showing numeric values for this data type; for example, 10 means that decimal values are shown</td> | <td>Number base used for showing numeric values for this data type; for example, 10 means that decimal values are shown</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>MINIMUM_SCALE</td> | <td>MINIMUM_SCALE</td> | ||
Line 1,583: | Line 1,703: | ||
<td>Minimum scale associated with this data type</td> | <td>Minimum scale associated with this data type</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>MAXIMUM_SCALE</td> | <td>MAXIMUM_SCALE</td> | ||
Line 1,594: | Line 1,715: | ||
The following table lists the CATALOG.ODBC_SCALES view columns and their descriptions.</p> | The following table lists the CATALOG.ODBC_SCALES view columns and their descriptions.</p> | ||
<table> | <table> | ||
< | <caption>ODBC_SCALES view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
Line 1,605: | Line 1,726: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>ODBC_SCALE</td> | <td>ODBC_SCALE</td> | ||
Line 1,613: | Line 1,735: | ||
===CONST view=== | ===CONST view=== | ||
The following table lists the CATALOG.CONST view columns and their descriptions.<table> | The following table lists the CATALOG.CONST view columns and their descriptions. | ||
< | |||
<tr> | <table> | ||
<caption>CONST view columns</caption> | |||
<tr class="head"> | |||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>DOUBLE_NULL</td> | <td>DOUBLE_NULL</td> | ||
Line 1,625: | Line 1,750: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>INTEGER_NULL</td> | <td>INTEGER_NULL</td> | ||
Line 1,630: | Line 1,756: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>REAL_NULL</td> | <td>REAL_NULL</td> | ||
Line 1,635: | Line 1,762: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SMALLINT_NULL</td> | <td>SMALLINT_NULL</td> | ||
Line 1,640: | Line 1,768: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CHAR1_NULL</td> | <td>CHAR1_NULL</td> | ||
Line 1,645: | Line 1,774: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CHAR12_NULL</td> | <td>CHAR12_NULL</td> | ||
Line 1,650: | Line 1,780: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CHAR18_NULL</td> | <td>CHAR18_NULL</td> | ||
Line 1,655: | Line 1,786: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CHAR128_NULL</td> | <td>CHAR128_NULL</td> | ||
Line 1,660: | Line 1,792: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CHAR255_NULL</td> | <td>CHAR255_NULL</td> | ||
Line 1,670: | Line 1,803: | ||
The following table lists the CATALOG.ODBC_COLUMNS view columns and their description. The ODBC_COLUMNS view contains a row of information for each discrete column defined to a catalogued table, and describes the type of data that can be held in that column. | The following table lists the CATALOG.ODBC_COLUMNS view columns and their description. The ODBC_COLUMNS view contains a row of information for each discrete column defined to a catalogued table, and describes the type of data that can be held in that column. | ||
<table> | <table> | ||
< | <caption>ODBC_COLUMNS view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_QUALIFIER</td> | <td>TABLE_QUALIFIER</td> | ||
Line 1,681: | Line 1,815: | ||
<td>Name of the catalog in which the column's table is catalogued (CCACAT)</td> | <td>Name of the catalog in which the column's table is catalogued (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_OWNER</td> | <td>TABLE_OWNER</td> | ||
Line 1,686: | Line 1,821: | ||
<td>Name of the owning schema (or ID) to which the column's table belongs</td> | <td>Name of the owning schema (or ID) to which the column's table belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,691: | Line 1,827: | ||
<td>Name of the table containing the column</td> | <td>Name of the table containing the column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN_NAME</td> | <td>COLUMN_NAME</td> | ||
Line 1,696: | Line 1,833: | ||
<td>Name of the column</td> | <td>Name of the column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>DATA_TYPE</td> | <td>DATA_TYPE</td> | ||
Line 1,701: | Line 1,839: | ||
<td>Integer code for the data type that is defined for this column (as described in the ODBC_TYPES view)</td> | <td>Integer code for the data type that is defined for this column (as described in the ODBC_TYPES view)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TYPE_NAME</td> | <td>TYPE_NAME</td> | ||
Line 1,706: | Line 1,845: | ||
<td>Name of the data type used for this column</td> | <td>Name of the data type used for this column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PRECISION_VAL</td> | <td>PRECISION_VAL</td> | ||
Line 1,711: | Line 1,851: | ||
<td>Maximum number of significant digits available for values for this column</td> | <td>Maximum number of significant digits available for values for this column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>LENGTH</td> | <td>LENGTH</td> | ||
Line 1,716: | Line 1,857: | ||
<td>Length in bytes of the data type used for this column</td> | <td>Length in bytes of the data type used for this column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SCALE</td> | <td>SCALE</td> | ||
Line 1,721: | Line 1,863: | ||
<td>Number of digits available to the right of the decimal point for values for this column</td> | <td>Number of digits available to the right of the decimal point for values for this column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>RADIX</td> | <td>RADIX</td> | ||
Line 1,726: | Line 1,869: | ||
<td>The number base used for numerical values for this column. 10 indicates decimal values.</td> | <td>The number base used for numerical values for this column. 10 indicates decimal values.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NULLABLE</td> | <td>NULLABLE</td> | ||
Line 1,731: | Line 1,875: | ||
<td>1 means NULLS ALLOWED for this column. 0 means NULLS are not allowed.</td> | <td>1 means NULLS ALLOWED for this column. 0 means NULLS are not allowed.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>REMARKS</td> | <td>REMARKS</td> | ||
Line 1,736: | Line 1,881: | ||
<td>General remarks on the column</td> | <td>General remarks on the column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_TYPE</td> | <td>TABLE_TYPE</td> | ||
Line 1,741: | Line 1,887: | ||
<td>Either TABLE for a base table, or VIEW, for a view defined against a table</td> | <td>Either TABLE for a base table, or VIEW, for a view defined against a table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SCOPE</td> | <td>SCOPE</td> | ||
Line 1,746: | Line 1,893: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PRIMARY_KEY</td> | <td>PRIMARY_KEY</td> | ||
Line 1,751: | Line 1,899: | ||
<td>The primary key for the column's table, if this table is a parent table</td> | <td>The primary key for the column's table, if this table is a parent table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PARENT_TABLE_NAME</td> | <td>PARENT_TABLE_NAME</td> | ||
Line 1,756: | Line 1,905: | ||
<td>The parent table name, if the column's table is a nested table</td> | <td>The parent table name, if the column's table is a nested table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SYSTEM_KEY</td> | <td>SYSTEM_KEY</td> | ||
Line 1,761: | Line 1,911: | ||
<td>The name of the system generated key used as a unique identifier, if the column's table is a parent table.</td> | <td>The name of the system generated key used as a unique identifier, if the column's table is a parent table.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NON_UNIQUE</td> | <td>NON_UNIQUE</td> | ||
Line 1,766: | Line 1,917: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TYPE_CODE</td> | <td>TYPE_CODE</td> | ||
Line 1,771: | Line 1,923: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SEQ_IN_INDEX</td> | <td>SEQ_IN_INDEX</td> | ||
Line 1,781: | Line 1,934: | ||
<p> | <p> | ||
The following table lists the CATALOG.ODBC_TABLES view columns and their descriptions. The ODBC_TABLES view contains a row of information for each discrete catalogued table or view.</p> | The following table lists the CATALOG.ODBC_TABLES view columns and their descriptions. The ODBC_TABLES view contains a row of information for each discrete catalogued table or view.</p> | ||
<table> | <table> | ||
<tr> | <caption>ODBC_TABLES view columns</caption> | ||
<tr class="head"> | |||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_QUALIFIER</td> | <td>TABLE_QUALIFIER</td> | ||
Line 1,793: | Line 1,948: | ||
<td>Name of the catalog in which the table is catalogued (CCACAT)</td> | <td>Name of the catalog in which the table is catalogued (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_OWNER</td> | <td>TABLE_OWNER</td> | ||
Line 1,798: | Line 1,954: | ||
<td>Name of the owning schema (or ID) to which the table belongs</td> | <td>Name of the owning schema (or ID) to which the table belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,803: | Line 1,960: | ||
<td>Name of the table or view</td> | <td>Name of the table or view</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_TYPE</td> | <td>TABLE_TYPE</td> | ||
Line 1,808: | Line 1,966: | ||
<td>Either TABLE for base table or VIEW for a view defined against a table</td> | <td>Either TABLE for base table or VIEW for a view defined against a table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>REMARKS</td> | <td>REMARKS</td> | ||
Line 1,818: | Line 1,977: | ||
<p> | <p> | ||
The following table lists the CATALOG.ODBC_SPECIAL_COLS view columns and their descriptions. The ODBC_SPECIAL_COLS view contains a row of information for each discrete column that is used to uniquely identify rows within a table. This view may also be used to show other specialized columns in the future.</p> | The following table lists the CATALOG.ODBC_SPECIAL_COLS view columns and their descriptions. The ODBC_SPECIAL_COLS view contains a row of information for each discrete column that is used to uniquely identify rows within a table. This view may also be used to show other specialized columns in the future.</p> | ||
<table> | <table> | ||
<tr> | <caption>ODBC_SPECIAL_COLS view columns</caption> | ||
<tr class="head"> | |||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_QUALIFIER</td> | <td>TABLE_QUALIFIER</td> | ||
Line 1,830: | Line 1,991: | ||
<td>Name of the catalog in which the column's table is catalogued (CCACAT)</td> | <td>Name of the catalog in which the column's table is catalogued (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_OWNER</td> | <td>TABLE_OWNER</td> | ||
Line 1,835: | Line 1,997: | ||
<td>Name of the owning schema (or ID) to which the column's table belongs</td> | <td>Name of the owning schema (or ID) to which the column's table belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,840: | Line 2,003: | ||
<td>Name of the table containing the specialized column</td> | <td>Name of the table containing the specialized column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SCOPE</td> | <td>SCOPE</td> | ||
Line 1,845: | Line 2,009: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN_NAME</td> | <td>COLUMN_NAME</td> | ||
Line 1,850: | Line 2,015: | ||
<td>Name of the specialized column. Typically this will be the name of the primary key of a parent table</td> | <td>Name of the specialized column. Typically this will be the name of the primary key of a parent table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>DATA_TYPE</td> | <td>DATA_TYPE</td> | ||
Line 1,855: | Line 2,021: | ||
<td>Integer code for the data type that is defined for this column (as described in the ODBC_TYPES view).</td> | <td>Integer code for the data type that is defined for this column (as described in the ODBC_TYPES view).</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TYPE_NAME</td> | <td>TYPE_NAME</td> | ||
Line 1,860: | Line 2,027: | ||
<td>Name of the data type used for this column</td> | <td>Name of the data type used for this column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PRECISION_VAL</td> | <td>PRECISION_VAL</td> | ||
Line 1,865: | Line 2,033: | ||
<td>Maximum number of significant digits available for values for this column</td> | <td>Maximum number of significant digits available for values for this column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>LENGTH</td> | <td>LENGTH</td> | ||
Line 1,870: | Line 2,039: | ||
<td>Length in bytes of the data type used for this column</td> | <td>Length in bytes of the data type used for this column</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SCALE</td> | <td>SCALE</td> | ||
Line 1,880: | Line 2,050: | ||
<p> | <p> | ||
The following table lists the CATALOG.ODBC_TABLE_STATS view columns and their descriptions. The ODBC_TABLE_STATS view contains a row of information for each discrete catalogued table or view.</p> | The following table lists the CATALOG.ODBC_TABLE_STATS view columns and their descriptions. The ODBC_TABLE_STATS view contains a row of information for each discrete catalogued table or view.</p> | ||
<table> | <table> | ||
< | <caption>ODBC_TABLE_STATS view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_QUALIFIER</td> | <td>TABLE_QUALIFIER</td> | ||
Line 1,892: | Line 2,064: | ||
<td>Name of the catalog in which the table is catalogues (CCACAT)</td> | <td>Name of the catalog in which the table is catalogues (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_OWNER</td> | <td>TABLE_OWNER</td> | ||
Line 1,897: | Line 2,070: | ||
<td>Name of the owning schema (or ID) to which the table belongs</td> | <td>Name of the owning schema (or ID) to which the table belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,902: | Line 2,076: | ||
<td>Name of the table or view</td> | <td>Name of the table or view</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NON_UNIQUE</td> | <td>NON_UNIQUE</td> | ||
Line 1,907: | Line 2,082: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>INDEX_QUALIFIER</td> | <td>INDEX_QUALIFIER</td> | ||
Line 1,912: | Line 2,088: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>INDEX_NAME</td> | <td>INDEX_NAME</td> | ||
Line 1,917: | Line 2,094: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TYPE_CODE</td> | <td>TYPE_CODE</td> | ||
Line 1,922: | Line 2,100: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SEQ_IN_INDEX</td> | <td>SEQ_IN_INDEX</td> | ||
Line 1,927: | Line 2,106: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN_NAME</td> | <td>COLUMN_NAME</td> | ||
Line 1,932: | Line 2,112: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLLATION</td> | <td>COLLATION</td> | ||
Line 1,937: | Line 2,118: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CARDINALITY</td> | <td>CARDINALITY</td> | ||
Line 1,942: | Line 2,124: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PAGES</td> | <td>PAGES</td> | ||
Line 1,952: | Line 2,135: | ||
<p> | <p> | ||
The following table lists the CATALOG.ODBC_KEY_STATS view columns and their descriptions.</p> | The following table lists the CATALOG.ODBC_KEY_STATS view columns and their descriptions.</p> | ||
<table> | <table> | ||
< | <caption>ODBC_KEY_STATS view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_QUALIFIER</td> | <td>TABLE_QUALIFIER</td> | ||
Line 1,964: | Line 2,149: | ||
<td>Name of the catalog in which the table is cataloged (CCACAT)</td> | <td>Name of the catalog in which the table is cataloged (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_OWNER</td> | <td>TABLE_OWNER</td> | ||
Line 1,969: | Line 2,155: | ||
<td>Name of the owning schema (or ID) to which the table belongs</td> | <td>Name of the owning schema (or ID) to which the table belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 1,974: | Line 2,161: | ||
<td>Name of the table</td> | <td>Name of the table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NON_UNIQUE</td> | <td>NON_UNIQUE</td> | ||
Line 1,980: | Line 2,168: | ||
0 means there is a unique identifier.</td> | 0 means there is a unique identifier.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>INDEX_QUALIFIER</td> | <td>INDEX_QUALIFIER</td> | ||
Line 1,985: | Line 2,174: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>INDEX_NAME</td> | <td>INDEX_NAME</td> | ||
Line 1,990: | Line 2,180: | ||
<td>Name of primary index for the table, if the table is a parent table</td> | <td>Name of primary index for the table, if the table is a parent table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TYPE_CODE</td> | <td>TYPE_CODE</td> | ||
Line 1,995: | Line 2,186: | ||
<td>Type of index</td> | <td>Type of index</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SEQ_IN_INDEX</td> | <td>SEQ_IN_INDEX</td> | ||
Line 2,000: | Line 2,192: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN_NAME</td> | <td>COLUMN_NAME</td> | ||
Line 2,005: | Line 2,198: | ||
<td>Name of column used as primary index for the table</td> | <td>Name of column used as primary index for the table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLLATION</td> | <td>COLLATION</td> | ||
Line 2,014: | Line 2,208: | ||
</td> | </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CARDINALITY</td> | <td>CARDINALITY</td> | ||
Line 2,019: | Line 2,214: | ||
<td>Number of rows in the table, or unique values in the primary index</td> | <td>Number of rows in the table, or unique values in the primary index</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PAGES</td> | <td>PAGES</td> | ||
Line 2,029: | Line 2,225: | ||
<p> | <p> | ||
The following table lists the CATALOG.ODBC_STATISTICS view columns and their descriptions. The ODBC_STATISTICS view contains a row of information for each discrete catalogued table or view, and is used to return statistics about the table and its indexes. </p> | The following table lists the CATALOG.ODBC_STATISTICS view columns and their descriptions. The ODBC_STATISTICS view contains a row of information for each discrete catalogued table or view, and is used to return statistics about the table and its indexes. </p> | ||
<table> | <table> | ||
< | <caption>ODBC_STATISTICS view columns</caption> | ||
<tr> | <tr class="head"> | ||
<th>Column name</th> | <th>Column name</th> | ||
<th>Data type</th> | <th>Data type</th> | ||
<th>Description</th> | <th>Description</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_QUALIFIER</td> | <td>TABLE_QUALIFIER</td> | ||
Line 2,041: | Line 2,239: | ||
<td>Name of the catalog in which the table is catalogued (CCACAT)</td> | <td>Name of the catalog in which the table is catalogued (CCACAT)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_OWNER</td> | <td>TABLE_OWNER</td> | ||
Line 2,046: | Line 2,245: | ||
<td>Name of the owning schema (or ID) to which the table belongs</td> | <td>Name of the owning schema (or ID) to which the table belongs</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TABLE_NAME</td> | <td>TABLE_NAME</td> | ||
Line 2,051: | Line 2,251: | ||
<td>Name of the table or view</td> | <td>Name of the table or view</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>NON_UNIQUE</td> | <td>NON_UNIQUE</td> | ||
Line 2,057: | Line 2,258: | ||
0 means there is a unique identifier.</td> | 0 means there is a unique identifier.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>INDEX_QUALIFIER</td> | <td>INDEX_QUALIFIER</td> | ||
Line 2,062: | Line 2,264: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>INDEX_NAME</td> | <td>INDEX_NAME</td> | ||
Line 2,067: | Line 2,270: | ||
<td>Name of primary index for the table, if the table is a parent table</td> | <td>Name of primary index for the table, if the table is a parent table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>TYPE_CODE</td> | <td>TYPE_CODE</td> | ||
Line 2,072: | Line 2,276: | ||
<td>Type of index</td> | <td>Type of index</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>SEQ_IN_INDEX</td> | <td>SEQ_IN_INDEX</td> | ||
Line 2,077: | Line 2,282: | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLUMN_NAME</td> | <td>COLUMN_NAME</td> | ||
Line 2,082: | Line 2,288: | ||
<td>Name of column used as primary index for the table</td> | <td>Name of column used as primary index for the table</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>COLLATION</td> | <td>COLLATION</td> | ||
Line 2,090: | Line 2,297: | ||
' ' = not applicable</td> | ' ' = not applicable</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>CARDINALITY</td> | <td>CARDINALITY</td> | ||
Line 2,095: | Line 2,303: | ||
<td>Number of rows in the table, or unique values in the primary index</td> | <td>Number of rows in the table, or unique values in the primary index</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>PAGES</td> | <td>PAGES</td> | ||
Line 2,101: | Line 2,310: | ||
</tr> | </tr> | ||
</table> | </table> | ||
==See also== | |||
{{Template:SQL topic list}} | |||
[[Category: Model 204 SQL processing]] | [[Category: Model 204 SQL processing]] |
Latest revision as of 19:09, 27 October 2017
To review the current contents of the SQL catalog you can query the catalog directly or you can use CCACATREPT, the SQL catalog reporting utility. This topic describes CCACATREPT and the queriable views of the SQL catalog.
SQL catalog reporting with CCACATREPT
The CCACATREPT subsystem is a reporting mechanism for data in the CCACAT SQL catalog file. CCACATREPT is a menu-driven utility that produces both online and printed output. With CCACATREPT you can produce a report that provides information about all SQL objects defined in the SQL catalog.
Catalog administrators can compare the CCACATREPT output to the Model 204 file data to determine the updates they need to make to the SQL catalog to obtain consistency with the file. They can modify the report's generated DDL and use it to repopulate the SQL catalog. SQL application programmers and SQL users can use the output to verify valid table, view, column names and column attributes.
This section describes the CCACATREPT menu and provides examples of each of the output formats. CCACATREPT produces the following types of online and printed output:
- File of valid DDL syntax, which you can use to rebuild the catalog
- Fixed format report of a table or view
- Privilege report by table or view name
- Privilege report by user
As an Application Subsystem utility, CCACATREPT is subject to typical Application Subsystem security, as described in System requirements for Application Subsystems. This is the case whether you are accessing CCACATREPT directly from your Model 204 command line as described on this page, or whether you are accessing from the RKTools main menu or the RKWeb interface. RKWeb uses Janus Web Legacy Support to serve facsimiles of the screens described on this page.
Logging in
Before you can log in to CCACATREPT, the CCACATREPT subsystem must already have been started with the Model 204 START SUBSYSTEM command. If you access CCACATREPT from the RKWeb interface, this command is probably already issued as part of the recommended set up for RKWeb.
To log in to CCACATREPT, at your Model 204 Online prompt enter CCACATREPT
and press Enter.
The CCACATREPT Main Menu is displayed.
CCACATREPT Main Menu
The Main Menu of CCACATREPT in the following figure displays the four output formats, their input parameters, and their output destination options.
Using the CCACATREPT panel
After you make final panel field selections and generate a report, CCACATREPT redisplays the panel with those selections.
You can enter an asterisk (*) in an input area to select all the items of a particular category.
The command line (===>) is at the bottom of the panel. Use the command line to enter commands in lieu of PF keys. The minimum abbreviation for a command is generally the first three characters, for example, REF
for REFresh. The minimum abbreviation appears in capital letters in the PF key display area.
The PF keys of the CCACATREPT main menu are described in the following table. In the RKWeb display, comparable buttons replace the PF keys.
Key | Explanation |
---|---|
PF1 = HELp |
You can access either general help information for the panel or additional individual panel field help information. To access general help information for this panel: To access individual panel field help information: |
PF2 = REFresh |
Refresh the screen, and do not process the current data on the screen. The refreshed screen appears as it does when you first entered the panel. |
PF3 = QUIt | Exit from CCACATREPT. Entries are not saved when you use PF3. |
Selection field
Using the Selection field you can generate output from any of the four reports numbered one through four on the menu. Enter an integer from 1 through 4, corresponding to the reports numbered on the menu. The report number you choose determines the input parameter fields. Your must supply one of the values that are listed below the Selection field. The report input parameter fields are followed by a specification in parentheses of the reports for which a value is required.
If you supply a value for a report that does not require it, you receive an error message asking you to remove your incorrect value.
Schema Name field
You must specify an entry in this field if you entered 1, 2, or 3 in the Selection field. Enter the name of a specific schema or enter an asterisk (*) for all schemas.
If your Selection field entry requires an entry for this field and you do not enter a value, by default CCACATREPT outputs all schemas.
Authorization ID field
You must specify an entry in this field if you entered 1 or 2 in the Selection field. Enter the name of a specific authorization ID or enter an asterisk (*) for all authorization IDs.
If your Selection field entry requires an entry for this field and you do not enter a value, by default CCACATREPT outputs all authorization IDs.
Table/View Name field
You must specify an entry in this field if you entered 1, 2, or 3 in the Selection field. Enter the name of a specific table or view to be reported or enter an asterisk (*) for all tables and views.
If your Selection field entry requires an entry for this field and you do not enter a value, by default CCACATREPT outputs all tables and views.
DDL Statement Type(s) field
You must specify an entry in this field if you entered 1 in the Selection field. The output from Selection 1 is standard SQL DDL generated from the Model 204 SQL catalog. In the DDL Statement Type(s) field, you identify the DDL statement types to be generated.
Select one or more of the following identifiers:
Identifier | Statement generated |
---|---|
T | CREATE TABLE |
V | CREATE VIEW |
G | GRANT |
T, V, or G | CREATE SCHEMA or SET SCHEMA CREATE TABLE, CREATE VIEW, and GRANT |
If your Selection field entry requires an entry for this field and you do not enter a value, by default CCACATREPT outputs all the DDL.
Grantee field
You must specify an entry in this field if you entered 4 in the Selection field. Enter the SQL identifier of a specific grantee to be reported or enter an asterisk (*) for all grantees. Privileges granted to PUBLIC are always reported.
If your Selection field entry requires an entry for this field and you do not enter a value, by default CCACATREPT outputs privileges for all grantees.
"USE" Command Arg
Use this field to route output to a destination other than to the terminal. The character string you enter in this field becomes the Model 204 USE command argument that identifies the output destination device.
You can enter any USE command argument that is valid in your operating environment, for example, PRINTER FOO or $PRINT *.
You can route your output to a file. Either dynamically allocate or have your system manager define or allocate an output file prior to your using it from CCACATREPT. For best results under z/OS (and comparably for VM and VSE), make sure that the following are specified in the DD statement or ALLOCATE command for the output file (data set):
- DD name begins with OUT.
- DISP=MOD, if you intend to generate multiple reports before processing the output file
- RECFM=FS, to prevent the printing to the file of carriage control characters
- LRECL=80, to facilitate the reading of the file by CVI or other DDL utility
For more information about the USE command, see USE command: Directing output.
Report Selection 1: Generate DDL
The first reporting option on the Main Menu is to generate the SQL DDL from the existing SQL catalog (CCACAT file) data. This DDL is output in valid SQL syntax that you can use to rebuild the catalog. You can also use it to report the existing catalog data in a standard format familiar to SQL users.
Note: Currently the CCACATREPT subsystem does not generate DDL statement delimiters. However, semicolons are required by the CVI utility. You can add delimiters by hand or use another SQL utility that does not require DDL delimiters. The Connect★ for ODBC unsupported utilities, DDLWIN and CLIIVP, are examples of utilities which accept DDL input lines without delimiters.
Specifying report input parameters
The required input parameters are described in the following table.
Required parameter | Enter... |
---|---|
Schema Name | Specific name, or asterisk (*) |
Authorization ID | Specific ID, or asterisk (*) |
Table/View Name | Specific name, or asterisk (*) |
DDL Statement Types | String of identifiers for the DDL statement types to be generated.
Enter one or more of the following options, without commas or spaces: |
Report input parameter examples
The following examples describe how the report input parameters are used.
Example 1
Specifying the parameters in this example produces CREATE SCHEMA, CREATE TABLE, CREATE VIEW, and GRANT DDL statements for all CCACAT objects.
Schema Name = * Authorization ID = * Table/View Name = * DDL Statement Types = tvg
Example 2
Specifying the parameters in this example produces SET SCHEMA and CREATE TABLE DDL statements for all tables with the authorization ID of USERxxx.
Schema Name = * Authorization ID = userxxx Table/View Name = * DDL Statement Types = t
Example 3
Specifying the parameters in this example produces SET SCHEMA, CREATE TABLE, and GRANT DDL statements for the table USERxxx.CLIENTS.
Schema Name = * Authorization ID = userxxx Table/View Name = clients DDL Statement Types = tg
Ordering the DDL output
The format of the DDL generated by this report option is the same as that generated by the TSF.
To set the schema context, CCACATREPT always places the CREATE SCHEMA or SET SCHEMA statement before the rest of the generated DDL. If you plan to process the generated DDL against the SQL catalog, you might have to change CREATE SCHEMA to SET SCHEMA, because issuing CREATE SCHEMA for a schema that already exists is an error.
For more information about creating schemas, changing the default schema context, and SQL DDL statement processing, see Setting the schema and user context.
You must order statements correctly to avoid forward referencing problems when the generated DDL is processed. For example, a view of a view must reference an already created view. The generated DDL sort order follows:
- Schemas in the order that they were originally input into the SQL catalog.
- Within a schema, all base and parent tables in alphanumeric order, followed by all nested tables in alphanumeric order. Privileges (GRANT statements) for each table follow that table.
- Views follow tables. They are in the order that they were originally input into the SQL catalog. GRANT statements for each view follow that view.
- Grants are ordered by privilege, column name, GRANT statement option, and grantee.
Sample of generated DDL
The sample DDL stream in the following figure is generated by the following input parameter specifications:
Schema Name = demo Authorization ID = * Table/View Name = clients DDL Statement Types = tvg
SET SCHEMA DEMO CREATE TABLE CLIENTS ( ADDRESS CHAR(40), AGENT CHAR(20), ANNIV_DATE SYSNAME 'ANNIV DATE' INT, CITY CHAR(20), DATE_OF_BIRTH SYSNAME 'DATE OF BIRTH' INT, DRIVER_ID SYSNAME 'DRIVER ID' INT, FULLNAME CHAR(40) NOT NULL, MARITAL_STATUS SYSNAME 'MARITAL STATUS' CHAR(15), POLICY_NO SYSNAME 'POLICY NO' CHAR(6) NOT NULL, POLICYHOLDER CHAR(40), RECTYPE CHAR(15) NOT NULL, RESTRICTIONS CHAR(255), SEX CHAR(1), STATE CHAR(25), TOTAL_PREMIUM SYSNAME 'TOTAL PREMIUM' INT, ZIP CHAR(9), PID INT NOT NULL PRIMARY KEY SYSTEM) -- GRANT STATEMENTS FOR TABLE: CLIENTS GRANT DELETE ON CLIENTS TO PUBLIC GRANT INSERT ON CLIENTS TO PUBLIC GRANT SELECT ON CLIENTS TO PUBLIC GRANT UPDATE ON CLIENTS TO PUBLIC
Report Selection 2: Formatted Table/View report
The Formatted Table/View report has a fixed format that provides the same information as the DDL generation report (except for granted privilege information), but in a different format.
Report input parameters
Input parameters for the report are:
- Specific schema name, or asterisk (*)
- Specific authorization ID, or asterisk (*)
- Specific table or view name, or asterisk (*)
Contents of the report
The report provides the following information for tables (see Sample report):
- Name of the SQL table
- Column names in the table
- SQL attributes of table columns
- Column names making up any multi-column unique columns
- Name of the corresponding Model 204 file
- Name of the corresponding Model 204 field
- Authorization ID
Note: The report does not provide information about views that reference a given table.
The report provides the following information for views:
- Name of the SQL view
- View definition text
Sample report
In the following figure, the sample output is generated by the following input parameter specifications:
Schema Name = demo Authorization ID = userxxx Table/View Name = clients
The output is a formatted table/view report of the DEMO.CLIENTS table.
18 NOV 09 SQL SCHEMA, TABLE, VIEW REPORT SCHEMA: DEMO AUTHORIZATION: USERXXX TABLE: CLIENTS TABLE-TYPE: PARENT PRIMARY-KEY: PID M204-FILE: CLIENTS SQL-COLUMN-NAME DATA-TYPE NULL UNQ MODEL-204-FIELD-NAME ADDRESS CHAR(40) Y N ADDRESS AGENT CHAR(20) Y N AGENT ANNIV_DATE INT Y N ANNIV DATE CITY CHAR(20) Y N CITY DATE_OF_BIRTH INT Y N DATE OF BIRTH DRIVER_ID INT Y N DRIVER ID FULLNAME CHAR(40) N N FULLNAME MARITAL_STATUS CHAR(15) Y N MARITAL STATUS POLICY_NO CHAR(6) N N POLICY NO POLICYHOLDER CHAR(40) Y N POLICYHOLDER RECTYPE CHAR(15) N N RECTYPE RESTRICTIONS CHAR(255) Y N RESTRICTIONS SEX CHAR(1) Y N SEX STATE CHAR(25) Y N STATE TOTAL_PREMIUM INT Y N TOTAL PREMIUM ZIP CHAR(9) Y N ZIP PID INT N Y PID
Report Selection 3: Privilege report by table/view
The Privilege report by table/view displays the DML update privileges for each table and view indicated by your input parameter specification. The update operations permitted per table and view, including WITH GRANT OPTION, are displayed for each grantee and for grants to PUBLIC.
The report has a fixed format. The sort order is by object name (schema name and table or view name), within that by grantee, and within that by column name, if applicable.
Report input parameters
Input parameters for the report are:
- Specific schema name, or asterisk (*)
- Specific table or view name, or asterisk (*)
Report display fields
The following table lists the report display fields and their meanings.
Field | Meaning |
---|---|
TABLE/VIEW | Name of the table or view for which indicated privileges are valid. |
GRANTEE | User ID for which the privileges are granted. |
SEL | If X, privilege to issue DML SELECT statement. If blank, no such privilege. |
INS | If X, privilege to issue DML INSERT statement. If blank, no such privilege. |
DEL | If X, privilege to issue DML DELETE statement. If blank, no such privilege. |
UPD | If X, privilege to issue DML UPDATE statement. If blank, no such privilege. |
OPT | If Y, option to grant this privilege to others. If N, no such privilege. |
COLUMN-NAME | For UPDATE only, specific columns for which the privilege is granted. Asterisk (*) means all columns. |
Sample Privilege Report by table and view
The sample output in the following figure is generated by the following input parameter specifications:
Schema Name = demo Table/View Name = *
The output is a privilege report for all the tables and views in the DEMO schema.
18 NOV 09 SQL PRIVILEGE REPORT -- BY TABLE/VIEW PAGE: 1 TABLE/VIEW: DEMO.ACCIDENTS GRANTEE SEL-OPT INS-OPT DEL-OPT UPD-OPT COLUMN-NAME PUBLIC X N X N X N X N USERXXX X Y X Y X Y X Y TABLE/VIEW: DEMO.CLAIMS03 GRANTEE SEL-OPT INS-OPT DEL-OPT UPD-OPT COLUMN-NAME PUBLIC X N X N X N X N USERXXX X Y X Y X Y X Y TABLE/VIEW: DEMO.CLIENTS GRANTEE SEL-OPT INS-OPT DEL-OPT UPD-OPT COLUMN-NAME PUBLIC X N X N X N X N USERXXX X Y X Y X Y X Y TABLE/VIEW: DEMO.DRIVERS GRANTEE SEL-OPT INS-OPT DEL-OPT UPD-OPT COLUMN-NAME PUBLIC X N X N X N X N USERXXX X N X N X N X Y TABLE/VIEW: DEMO.INSURED_VINS GRANTEE SEL-OPT INS-OPT DEL-OPT UPD-OPT COLUMN-NAME PUBLIC X N X N X N X N USERXXX X Y X Y X Y X Y TABLE/VIEW: DEMO.OTHER_DRIVER GRANTEE SEL-OPT INS-OPT DEL-OPT UPD-OPT COLUMN-NAME PUBLIC X N X N X N X N USERXXX X Y X Y X Y X Y TABLE/VIEW: DEMO.POLICIES GRANTEE SEL-OPT INS-OPT DEL-OPT UPD-OPT COLUMN-NAME PUBLIC X N X N X N X N USERXXX X N X N X N X Y TABLE/VIEW: DEMO.VEHICLES GRANTEE SEL-OPT INS-OPT DEL-OPT UPD-OPT COLUMN-NAME PUBLIC X N X N X N X N USERXXX X Y X Y X Y X Y 18 NOV 09 SQL PRIVILEGE REPORT -- BY TABLE/VIEW PAGE: 2
Report Selection 4: Privilege report by grantee
The Privilege report by grantee displays the DML update privileges for each grantee indicated by your input parameter specification. The update operations permitted, including WITH GRANT OPTION, are displayed for each table or view. Privileges granted to PUBLIC are displayed under GRANTEE=PUBLIC.
The report has a fixed format. The sort order is by grantee, within that by object name (schema name and table or view name), and within that by column name, if applicable.
Report input parameter
The required input parameter for the report is: Specific grantee (or *).
Report display fields
The report display fields have the same meanings as those for Privilege report by table/view display fields.
Sample report
A sample of this report appears in the following figure, generated by the following input parameter specification:
Grantee = userxxx
The output is a report of all the privileges granted to USERXXX or to PUBLIC.
18 NOV 09 SQL PRIVILEGE REPORT -- BY GRANTEE PAGE: 1 GRANTEE: PUBLIC TABLE/VIEW SEL-OPT INS-OPT DEL-OPT UPD-OPT COLUMN-NAME DEMO.ACCIDENTS X N X N X N X N DEMO.CLAIMS03 X N X N X N X N DEMO.CLIENTS X N X N X N X N DEMO.DRIVERS X N X N X N X N DEMO.INSURED_VINS X N X N X N X N DEMO.OTHER_DRIVER X N X N X N X N DEMO.POLICIES X N X N X N X N DEMO.VEHICLES X N X N X N X N GRANTEE: USERXXX TABLE/VIEW SEL-OPT INS-OPT DEL-OPT UPD-OPT COLUMN-NAME DEMO.ACCIDENTS X Y X Y X Y X Y DEMO.CLAIMS03 X Y X Y X Y X Y DEMO.CLIENTS X Y X Y X Y X Y DEMO.DRIVERS X N X N X N X Y DEMO.INSURED_VINS X Y X Y X Y X Y DEMO.OTHER_DRIVER X Y X Y X Y X Y DEMO.POLICIES X N X N X N X Y DEMO.VEHICLES X Y X Y X Y X Y
Querying the SQL catalog
You can directly query the Model 204 SQL catalog to obtain information about the current catalog definitions. Any authorized SQL user can access (but not update) any of 18 views of the catalog contents. You use a normal SQL query and devise your own report format for information from the catalog views.
The SQL catalog contains a schema named CATALOG that is comprised of the views of the catalog contents. The views are defined by SQL object. For example, the schemas view in CATALOG contains all the schemas in the catalog by name and by authorization ID.
The CATALOG views are listed here and described individually in the rest of this section.
SCHEMAS (or SCHEMATA) TABLES TABLE_COLUMNS COLUMNS (for tables and views) VIEWS TABLE_CONSTRAINTS KEY_COLUMN_USAGE TABLE_PRIVILEGES COLUMN_PRIVILEGES ODBC_TYPES ODBC_SCALES CONST ODBC_COLUMNS ODBC_SPECIAL_COLS ODBC_TABLES ODBC_TABLE_STATS ODBC_KEY_STATS ODBC_STATISTICS
Querying a CATALOG view
Authorized Model 204 SQL users can query any of the CATALOG views like any other SQL object. However, the views display to you only the SQL objects or information that you have the authority to see or that are granted to PUBLIC.
For example, USERXXX issues the following query against the Model 204 demonstration database:
SELECT * FROM CATALOG.TABLES
The result is a display of information about the tables USERXXX has the authority to select or update. The query's output is shown in the following figure. The format of the output depends on your application and is your responsibility.
The CATALOG.TABLES columns (described in TABLES view), ordered from left to right, are:
TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, FILE_NAME, TABLE_TYPE, COLUMN_CARDINALITY, PRIMARY_KEY, SYSTEM_KEY, PARENT_TABLE_NAME, TIMESTAMP
This is the default display order, which derives from the order of the columns in the individual CATALOG view definition.
CCACAT |
CATALOG |
SCHEMAS |
|
V |
4 |
|
4 |
|
19920911000004 |
CCACAT |
CATALOG |
TABLES |
|
V |
10 |
|
10 |
|
19920911000007 |
CCACAT |
CATALOG |
TABLE_COLUMNS |
|
V |
11 |
|
11 |
|
19920911000010 |
CCACAT |
CATALOG |
COLUMNS |
|
V |
8 |
|
8 |
|
19920911000000 |
CCACAT |
CATALOG |
VIEWS |
|
V |
6 |
|
6 |
|
19920911000016 |
CCACAT |
CATALOG |
TABLE_CONSTRAINTS |
|
V |
6 |
|
6 |
|
19920911000019 |
CCACAT |
CATALOG |
KEY_COLUMN_USAGE |
|
V |
5 |
|
5 |
|
19920911000022 |
CCACAT |
CATALOG |
TABLE_PRIVILEGES |
|
V |
8 |
|
8 |
|
19920911000025 |
CCACAT |
CATALOG |
COLUMN_PRIVILEGES |
|
V |
9 |
|
9 |
|
19920911000028 |
CCACAT |
CATALOG |
ODBC_TYPES |
|
V |
|
|
16 |
|
19981201142400 |
CCACAT |
CATALOG |
ODBC_SCALES |
|
V |
|
|
2 |
|
19981201142400 |
CCACAT |
CATALOG |
CONST |
|
V |
|
|
9 |
|
19981201142400 |
CCACAT |
CATALOG |
ODBC_COLUMNS |
|
V |
|
|
17 |
|
19981201142400 |
CCACAT |
CATALOG |
ODBC_SPECIAL_COLS |
|
V |
|
|
10 |
|
19981201142400 |
CCACAT |
CATALOG |
ODBC_TABLES |
|
V |
|
|
5 |
|
19981201142401 |
CCACAT |
CATALOG |
ODBC_TABLE_STATS |
|
V |
|
|
12 |
|
19981201142401 |
CCACAT |
CATALOG |
ODBC_KEY_STATS |
|
V |
|
|
12 |
|
19981201142401 |
CCACAT |
CATALOG |
ODBC_STATISTICS |
|
V |
|
|
12 |
|
19981201142401 |
CCACAT |
USERXXX |
DRIVERS |
|
V |
9 |
|
|
|
19921117183249 |
CCACAT |
USERXXX |
POLICIES |
|
V |
9 |
|
|
|
19921117183250 |
CCACAT |
USERXXX |
CLIENTS |
CLIENTS |
T |
17 |
PID |
1 |
|
19921117183251 |
CCACAT |
USERXXX |
ACCIDENTS |
CLIENTS |
T |
3 |
PID |
1 |
CLIENTS |
19921117183253 |
CCACAT |
USERXXX |
INSURED_VINS |
CLIENTS |
T |
2 |
PID |
1 |
CLIENTS |
19921117183254 |
CCACAT |
USERXXX |
VEHICLES |
VEHICLES |
T |
19 |
VIN |
0 |
CLIENTS |
19921117183254 |
CCACAT |
USERXXX |
OTHER_DRIVER |
VEHICLES |
T |
2 |
VIN |
0 |
VEHICLES |
19921117183256 |
CCACAT |
USERXXX |
CLAIMS03 |
CLAIMS03 |
T |
13 |
VIN |
0 |
VEHICLES |
19921117183258 |
The output in the previous figure is from two schemas: CATALOG and USERXXX. The CATALOG schema contains the 18 views that describe the catalog contents and is granted to PUBLIC. You can limit the output to the tables in schema USERXXX by using the following SELECT statement:
SELECT * FROM CATALOG.TABLES WHERE TABLE_SCHEMA='USERXXX'
You can list specific columns for display instead of using SELECT *. For example, the following statement results in the same display as that in the previous figure:
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, FILE_NAME, TABLE_TYPE, COLUMN_CARDINALITY, PRIMARY_KEY, SYSTEM_KEY, PARENT_TABLE_NAME, TIMESTAMP FROM CATALOG.TABLES
The output in the previous figure is grouped by schema, because that is how the DDL used to populate the SQL catalog was organized. An unqualified SQL catalog query returns data chronologically in the order in which the SQL objects were defined or updated in the SQL catalog. As new tables are added to which USERXXX is granted access, this convenient grouping is likely to be lost.
You can ensure that your output is appropriately ordered by sorting the rows by column value with the ORDER BY clause. For example, the following statement sorts the query output by table name, as shown in the following figure:
SELECT * FROM CATALOG.TABLES WHERE TABLE_SCHEMA='USERXXX' ORDER BY TABLE_SCHEMA, TABLE_NAME
CCACAT |
USERXXX |
ACCIDENTS |
CLIENTS |
T |
3 |
PID |
1 |
CLIENTS |
19921117183253 |
CCACAT |
USERXXX |
CLAIMS03 |
CLAIMS03 |
T |
13 |
VIN |
0 |
VEHICLES |
19921117183258 |
CCACAT |
USERXXX |
CLIENTS |
CLIENTS |
T |
17 |
PID |
1 |
|
19921117183251 |
CCACAT |
USERXXX |
DRIVERS |
|
V |
9 |
|
|
|
19921117183249 |
CCACAT |
USERXXX |
INSURED_VINS |
CLIENTS |
T |
2 |
PID |
1 |
CLIENTS |
19921117183254 |
CCACAT |
USERXXX |
OTHER_DRIVER |
VEHICLES |
T |
2 |
VIN |
0 |
VEHICLES |
19921117183256 |
CCACAT |
USERXXX |
POLICIES |
|
V |
9 |
|
|
|
19921117183250 |
CCACAT |
USERXXX |
VEHICLES |
VEHICLES |
T |
19 |
VIN |
0 |
CLIENTS |
19921117183254 |
Rules for CATALOG queries
- A query against a table that does not exist returns an empty result.
- A query against a table that you do not have the authority to access returns an empty result.
- You cannot issue update SQL DML against the CATALOG views.
SCHEMAS view
The following table lists the CATALOG.SCHEMAS view columns and their descriptions. This view contains a row of identifying information for each schema whose authorization ID is your login ID.
SCHEMATA is an alias for SCHEMAS. You can query either SCHEMAS or SCHEMATA.
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT *
query against the view.
Column name | Data type | Description |
---|---|---|
SCHEMA_CATALOG | CHAR(18) | Name of the catalog where the schema is cataloged (CCACAT) |
SCHEMA_NAME | CHAR(18) | Name of the schema |
SCHEMA_OWNER | CHAR(18) | Authorization ID of the owner of the schema |
TIMESTAMP | CHAR(14) | Greenwich mean time when the schema description was cataloged |
TABLES view
The following table lists the CATALOG.TABLES view columns and their descriptions. This view contains a row of descriptive information for each table or view you have the authority to access.
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT *
query against the view.
Column name | Data type | Description |
---|---|---|
TABLE_CATALOG | CHAR(18) | Name of the catalog in which the table is cataloged (CCACAT) |
TABLE_SCHEMA | CHAR(18) | Name of the schema to which the table belongs |
TABLE_NAME | CHAR(18) | Name of the table |
FILE_NAME | CHAR(8) | Name of the Model 204 file to which the table maps |
TABLE_TYPE | CHAR(1) | Type of table: either T (table), or V (view) |
COLUMN_CARDINALITY | INTEGER | Number of columns defined in the table being described |
PRIMARY_KEY | CHAR(18) | Name of any primary or nested key column; otherwise, null |
SYSTEM_KEY | CHAR(1) | 0 if the primary or nested key column is not system-generated 1 if the primary or nested key column is system-generated null if there is no primary or nested key |
PARENT_TABLE_NAME | CHAR(18) | Name of parent table if the table is nested; otherwise, null |
TIMESTAMP | CHAR(14) | Greenwich mean time when the table description was cataloged |
TABLE_COLUMNS view
The following table lists the CATALOG.TABLE_COLUMNS view columns and their descriptions. This view contains a row of column definition information for each column in each base or nested table you have the authority to access. The TABLE_COLUMNS view contains column definition information not contained in the COLUMNS view, for example, the name of the Model 204 field to which the column maps.
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT *
query against the view.
Column name | Data type | Description |
---|---|---|
TABLE_CATALOG | CHAR(18) | Name of the catalog in which the table is cataloged (CCACAT) |
TABLE_SCHEMA | CHAR(18) | Name of the schema to which the table belongs |
TABLE_NAME | CHAR(18) | Name of the table |
COLUMN_NAME | CHAR(18) | Name of the column |
FIELD_NAME | CHAR(255) | Name of the Model 204 field to which the column maps |
NUMERIC_PRECISION | INTEGER | Maximum numeric precision of the column values |
NUMERIC_SCALE | INTEGER | Numeric scale of the column values |
CHAR_MAX_LENGTH | INTEGER | Maximum length of string values, if the column data type is CHAR; otherwise, zero |
DATA_TYPE | CHAR(10) | SQL data type of the column (not the Model 204 field attribute) |
NULL_ALLOWED | CHAR(1) | 1, if NULL values are allowed for the column; otherwise, 0 |
COL_UNIQUE | CHAR(1) | 1, if the values in the column are unique; otherwise, 0 |
COLUMNS view
The following table lists the CATALOG.COLUMNS view columns and their descriptions. The COLUMNS view contains a row of column definition information for each column in each base table, nested table, or view you have the authority to access.
Column information for views is limited to the column name. For more view column attribute information, query the TABLE_COLUMNS view for the base tables referenced in the view definition FROM clause.
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT *
query against the view.
Column name | Data type | Description |
---|---|---|
TABLE_CATALOG | CHAR(18) | Name of the catalog in which the column's table is cataloged (CCACAT) |
TABLE_SCHEMA | CHAR(18) | Name of the schema to which the column's table or view belongs |
TABLE_NAME | CHAR(18) | Name of the column's table or view |
COLUMN_NAME | CHAR(18) | Name of the column |
NUMERIC_PRECISION | INTEGER | Table columns: maximum numeric precision of the table column values View columns: 0 (not stored) |
NUMERIC_SCALE | INTEGER | Table columns: numeric scale of the column values View columns: 0 (not stored) |
CHAR_MAX_LENGTH | INTEGER | Table columns: maximum length of string values, if the column data type is CHAR; otherwise, zero View columns: 0 (not stored) |
DATA_TYPE | CHAR(10) | Table columns: SQL data type of the column (derived for views from the corresponding columns in the underlying base tables) View columns: UNAVAIL (not stored) |
VIEWS view
The following table lists the CATALOG.VIEWS view columns and their descriptions. The VIEWS view contains a row of information including the view definition for each view you have the authority to access.
Except for the view definition, CATALOG.VIEWS does not provide information about tables or columns referenced by views you have the authority to access.
If a view definition has more than 255 characters, it is continued in the VIEW_DEFINITION column on one or more additional rows. Except for the view definition, the column values in these extra rows duplicate those in the row with the beginning of the view definition.
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT *
query against the view.
Column name | Data type | Description |
---|---|---|
TABLE_CATALOG | CHAR(18) | Name of the catalog in which the view is cataloged (CCACAT) |
TABLE_SCHEMA | CHAR(18) | Name of the schema to which the view belongs |
TABLE_NAME | CHAR(18) | Name of the view |
VIEW_DEFINITION | CHAR(255) | The view definition source string without the CREATE VIEW viewname phrase. You might want to include TABLE_SCHEMA and TABLE_NAME in your query to help identify the view definition output. |
CHECK_OPTION | CHAR(1) | 1, if WITH CHECK OPTION clause is present in the view definition; otherwise, 0 |
UPDATABLE | CHAR(1) | 1, if data may be inserted, deleted, or updated through this view; otherwise, 0 |
TABLE_CONSTRAINTS view
The following table lists the CATALOG.TABLE_CONSTRAINTS view columns and their descriptions. The TABLE_CONSTRAINTS view contains a row of information for each multi-column unique constraint in a base table you have the authority to access.
This view displays only multi-column unique constraints; primary key and foreign key constraints are not displayed. The names of the columns participating in each multi-column unique key are displayed in the KEY_COLUMN_USAGE view.
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT *
query against the view.
Column name | Data type | Description |
---|---|---|
CONSTRAINT_CATALOG | CHAR(18) | Name of the catalog in which the constraint table is cataloged (CCACAT) |
CONSTRAINT_SCHEMA | CHAR(18) | Name of the schema to which the constraint table belongs |
TABLE_NAME | CHAR(18) | Name of the table in which the constraint was defined |
CONSTRAINT_FIELD | CHAR(255) | Name of the UNIQUE Model 204 field that is used to generate the Model 204 index and constraints |
CONSTRAINT_TYPE | CHAR(1) | U, for unique |
TIMESTAMP | CHAR(14) | Greenwich mean time when the table constraint was cataloged |
KEY_COLUMN_USAGE view
The following table lists the CATALOG.KEY_COLUMN_USAGE view columns and their descriptions. The KEY_COLUMN_USAGE view contains a row of information for each multicolumn unique constraint in each base table you have the authority to access. The information includes the name of each column participating in a multicolumn unique key.
This view is only for columns that participate in multicolumn unique constraints; primary key and foreign key constraints are not displayed.
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT *
query against the view.
Column name | Data type | Description |
---|---|---|
CONSTRAINT_CATALOG | CHAR(18) | Name of the catalog in which the constraint table is cataloged (CCACAT) |
CONSTRAINT_SCHEMA | CHAR(18) | Name of the schema to which the constraint table belongs |
TABLE_NAME | CHAR(18) | Name of the table in which the constraint is defined |
CONSTRAINT_FIELD | CHAR(255) | Name of the UNIQUE Model 204 field that is used to generate Model 204 index and constraints |
COLUMN_NAME | CHAR(18) | Name of a column that participates in a multicolumn constraint; one row is returned for each column used in a multicolumn unique key |
TABLE_PRIVILEGES view
The following table lists the CATALOG.TABLE_PRIVILEGES view columns and their descriptions. The TABLE_PRIVILEGES view contains a row for each table and view for which you have or have granted a DML update privilege.
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT *
query against the view.
Column name | Data type | Description |
---|---|---|
GRANTOR | CHAR(18) | Authorization ID of the user giving the privilege |
GRANTEE | CHAR(18) | Authorization ID, which may be PUBLIC (all users), of the user given the privilege |
TABLE_CATALOG | CHAR(18) | Name of the catalog in which the table or view is cataloged (CCACAT) |
TABLE_SCHEMA | CHAR(18) | Name of the schema to which the table or view belongs |
TABLE_NAME | CHAR(18) | Name of the table or view |
PRIVILEGE | CHAR(6) | Type of privilege: SELECT, INSERT, DELETE, or UPDATE |
GRANTABLE | CHAR(1) | 1, if the privilege includes WITH GRANT OPTION; otherwise, 0 |
TIMESTAMP | CHAR(14) | Greenwich mean time when the table privilege was cataloged |
COLUMN_PRIVILEGES view
The following table lists the CATALOG.COLUMN_PRIVILEGES view columns and their descriptions. The COLUMN_PRIVILEGES view contains a row for each DML update privilege you have or have granted for a column.
The top-to-bottom order of the columns in the following table is the left-to-right order of the columns in each row of output you receive from an unqualified SELECT *
query against the view.
Column name | Data type | Description |
---|---|---|
GRANTOR | CHAR(18) | Authorization ID of the user giving the privilege |
GRANTEE | CHAR(18) | Authorization ID, which may be PUBLIC (all users), of the user given the privilege |
TABLE_CATALOG | CHAR(18) | Name of the catalog in which the table or view is cataloged (CCACAT) |
TABLE_SCHEMA | CHAR(18) | Name of the schema to which the table or view belongs |
TABLE_NAME | CHAR(18) | Name of the table or view |
COLUMN_NAME | CHAR(18) | Name of a column from the list of columns for which update privilege is granted; one row is returned for each such column |
PRIVILEGE | CHAR(6) | Type of privilege: SELECT, INSERT, DELETE, or UPDATE |
GRANTABLE | CHAR(1) | 1, if the privilege includes WITH GRANT OPTION; otherwise, 0 |
TIMESTAMP | CHAR(14) | Greenwich mean time when the column privilege was cataloged |
ODBC_TYPES view
The following table lists the CATALOG.ODBC_TYPES and their descriptions. The ODBC_TYPES view contains a row of information for each discrete data type supported by the Connect★ drivers.
Column name | Data type | Description |
---|---|---|
TYPE_NAME | CHAR(16) | Name of a data type that can be used for defining columns to be accessed through ODBC |
DATA_TYPE | CHAR(15) | Data type code number for the data type, as specified in the ODBC API |
PRECISION_VAL | INTEGER(4) | Maximum precision for this data type. 0 is returned, if precision is not applicable |
LITERAL_PREFIX | CHAR(1) | Character used to prefix a literal. For example, a single quotation mark (') is used for CHAR data type literals |
LITERAL_SUFFIX | CHAR(1) | Character used to terminate a literal, for example, a single quotation mark (') is used to terminal a CHAR data type literal |
CREATE_PARAMS | CHAR(15) | Description of the creation parameters for this data type. For example, LENGTH is specified for a CHAR data type |
NULLABLE | SMALLINT(2) | Flag indicating whether columns with this data type are nullable 1 indicates yes |
CASE_SENSITIVE | SMALLINT(2) | 1 means columns of this type are case sensitive 0 means they are not |
SEARCHABLE | SMALLINT(2) | 2 means columns of this type can be used in a WHERE clause on a SELECT, except with LIKE 3 means they can be used also with LIKE |
UNSIGNED_ATTRIBUTE | SMALLINT | 1 means the data type is unsigned; 0 means it is signed |
MONEY | SMALLINT(2) | 1 means a monetary data type; 0 means it is not |
AUTO_INCREMENT | SMALLINT(2) | 1 means columns of this type are automatically incremented (set to a unique value when a new row is inserted) 0 means they are not automatically incremented |
LOCAL_TYPE_NAME | CHAR(10) | Localized name for this data type on this data source that is different from the standard data type name |
RADIX | SMALLINT(2) | Number base used for showing numeric values for this data type; for example, 10 means that decimal values are shown |
MINIMUM_SCALE | SMALLINT(2) | Minimum scale associated with this data type |
MAXIMUM_SCALE | SMALLINT(2) | Maximum scale associated with this data type |
ODBC_SCALES view
The following table lists the CATALOG.ODBC_SCALES view columns and their descriptions.
Column name | Data type | Description |
---|---|---|
CHAR_SCALE | CHAR(4) | |
ODBC_SCALE | SMALLINT(2) |
CONST view
The following table lists the CATALOG.CONST view columns and their descriptions.
Column name | Data type | Description |
---|---|---|
DOUBLE_NULL | DOUBLE PRECISION(8) | |
INTEGER_NULL | INTEGER(4) | |
REAL_NULL | REAL(4) | |
SMALLINT_NULL | SMALLINT(2) | |
CHAR1_NULL | CHAR(1) | |
CHAR12_NULL | CHAR(12) | |
CHAR18_NULL | CHAR(18) | |
CHAR128_NULL | CHAR(128) | |
CHAR255_NULL | CHAR(255) |
ODBC_COLUMNS view
The following table lists the CATALOG.ODBC_COLUMNS view columns and their description. The ODBC_COLUMNS view contains a row of information for each discrete column defined to a catalogued table, and describes the type of data that can be held in that column.
Column name | Data type | Description |
---|---|---|
TABLE_QUALIFIER | CHAR(18) | Name of the catalog in which the column's table is catalogued (CCACAT) |
TABLE_OWNER | CHAR(18) | Name of the owning schema (or ID) to which the column's table belongs |
TABLE_NAME | CHAR(18) | Name of the table containing the column |
COLUMN_NAME | CHAR(18) | Name of the column |
DATA_TYPE | SMALLINT(2) | Integer code for the data type that is defined for this column (as described in the ODBC_TYPES view) |
TYPE_NAME | CHAR(16) | Name of the data type used for this column |
PRECISION_VAL | INTEGER(4) | Maximum number of significant digits available for values for this column |
LENGTH | INTEGER(4) | Length in bytes of the data type used for this column |
SCALE | CHAR(4) | Number of digits available to the right of the decimal point for values for this column |
RADIX | SMALLINT(2) | The number base used for numerical values for this column. 10 indicates decimal values. |
NULLABLE | SMALLINT(2) | 1 means NULLS ALLOWED for this column. 0 means NULLS are not allowed. |
REMARKS | CHAR(254) | General remarks on the column |
TABLE_TYPE | CHAR(14) | Either TABLE for a base table, or VIEW, for a view defined against a table |
SCOPE | SMALLINT(2) | |
PRIMARY_KEY | CHAR(18) | The primary key for the column's table, if this table is a parent table |
PARENT_TABLE_NAME | CHAR(18) | The parent table name, if the column's table is a nested table |
SYSTEM_KEY | CHAR(1) | The name of the system generated key used as a unique identifier, if the column's table is a parent table. |
NON_UNIQUE | ||
TYPE_CODE | ||
SEQ_IN_INDEX |
ODBC_TABLES view
The following table lists the CATALOG.ODBC_TABLES view columns and their descriptions. The ODBC_TABLES view contains a row of information for each discrete catalogued table or view.
Column name | Data type | Description |
---|---|---|
TABLE_QUALIFIER | CHAR(18) | Name of the catalog in which the table is catalogued (CCACAT) |
TABLE_OWNER | CHAR(18) | Name of the owning schema (or ID) to which the table belongs |
TABLE_NAME | CHAR(18) | Name of the table or view |
TABLE_TYPE | CHAR(12) | Either TABLE for base table or VIEW for a view defined against a table |
REMARKS | CHAR(254) | General notes on the table |
ODBC_SPECIAL_COLS view
The following table lists the CATALOG.ODBC_SPECIAL_COLS view columns and their descriptions. The ODBC_SPECIAL_COLS view contains a row of information for each discrete column that is used to uniquely identify rows within a table. This view may also be used to show other specialized columns in the future.
Column name | Data type | Description |
---|---|---|
TABLE_QUALIFIER | CHAR(18) | Name of the catalog in which the column's table is catalogued (CCACAT) |
TABLE_OWNER | CHAR(18) | Name of the owning schema (or ID) to which the column's table belongs |
TABLE_NAME | CHAR(18) | Name of the table containing the specialized column |
SCOPE | SMALLINT(2) | |
COLUMN_NAME | CHAR(18) | Name of the specialized column. Typically this will be the name of the primary key of a parent table |
DATA_TYPE | SMALLINT(2) | Integer code for the data type that is defined for this column (as described in the ODBC_TYPES view). |
TYPE_NAME | CHAR(16) | Name of the data type used for this column |
PRECISION_VAL | INTEGER(4) | Maximum number of significant digits available for values for this column |
LENGTH | INTEGER(4) | Length in bytes of the data type used for this column |
SCALE | SMALLINT(2) | Number of digits available to the right of the decimal point for values for this column |
ODBC_TABLE_STATS view
The following table lists the CATALOG.ODBC_TABLE_STATS view columns and their descriptions. The ODBC_TABLE_STATS view contains a row of information for each discrete catalogued table or view.
Column name | Data type | Description |
---|---|---|
TABLE_QUALIFIER | CHAR(18) | Name of the catalog in which the table is catalogues (CCACAT) |
TABLE_OWNER | CHAR(18) | Name of the owning schema (or ID) to which the table belongs |
TABLE_NAME | CHAR(18) | Name of the table or view |
NON_UNIQUE | SMALLINT(2) | |
INDEX_QUALIFIER | CHAR(18) | |
INDEX_NAME | CHAR(18) | |
TYPE_CODE | SMALLINT(2) | |
SEQ_IN_INDEX | SMALLINT(2) | |
COLUMN_NAME | CHAR(18) | |
COLLATION | CHAR(1) | |
CARDINALITY | INTEGER(4) | |
PAGES | INTEGER(4) |
ODBC_KEY_STATS view
The following table lists the CATALOG.ODBC_KEY_STATS view columns and their descriptions.
Column name | Data type | Description |
---|---|---|
TABLE_QUALIFIER | CHAR(18) | Name of the catalog in which the table is cataloged (CCACAT) |
TABLE_OWNER | CHAR(18) | Name of the owning schema (or ID) to which the table belongs |
TABLE_NAME | CHAR(181) | Name of the table |
NON_UNIQUE | SMALLINT(2) | 1 means there is no unique identifier for row in the table. 0 means there is a unique identifier. |
INDEX_QUALIFIER | CHAR(18) | |
INDEX_NAME | CHAR(18) | Name of primary index for the table, if the table is a parent table |
TYPE_CODE | SMALLINT(2) | Type of index |
SEQ_IN_INDEX | SMALLINT(2) | |
COLUMN_NAME | CHAR(18) | Name of column used as primary index for the table |
COLLATION | CHAR(1) | Collation sequence for rows in the table. A = ascending |
CARDINALITY | INTEGER(4) | Number of rows in the table, or unique values in the primary index |
PAGES | INTEGER(4) | Number of pages used to store the index or table. |
ODBC_STATISTICS view
The following table lists the CATALOG.ODBC_STATISTICS view columns and their descriptions. The ODBC_STATISTICS view contains a row of information for each discrete catalogued table or view, and is used to return statistics about the table and its indexes.
Column name | Data type | Description |
---|---|---|
TABLE_QUALIFIER | CHAR(18) | Name of the catalog in which the table is catalogued (CCACAT) |
TABLE_OWNER | CHAR(18) | Name of the owning schema (or ID) to which the table belongs |
TABLE_NAME | CHAR(180) | Name of the table or view |
NON_UNIQUE | SMALLINT(2) | 1 means there is no unique identifier for row in the table or view. 0 means there is a unique identifier. |
INDEX_QUALIFIER | CHAR(18) | |
INDEX_NAME | CHAR(18) | Name of primary index for the table, if the table is a parent table |
TYPE_CODE | SMALLINT(2) | Type of index |
SEQ_IN_INDEX | SMALLINT(2) | |
COLUMN_NAME | CHAR(18) | Name of column used as primary index for the table |
COLLATION | CHAR(1) | Collation sequence for rows in the table. A = ascending |
CARDINALITY | INTEGER(4) | Number of rows in the table, or unique values in the primary index |
PAGES | INTEGER(4) | Number of pages used to store the index or table. |
See also
- SQL Server overview
- SQL Server installation
- SQL catalog
- SQL representation of Model 204 data
- SQL Data Definition Language (DDL)
- SQL DDL from the Table Specification Facility
- SQL catalog reporting and querying
- SQL Data Manipulation Language (DML)
- SQL DDL syntax
- SQL reserved words
- SQL DDL mapping of the demonstration database