Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
All catalog functions accept arguments with which an application can restrict the scope of the data returned. For example, the first and second calls to SQLTables in the following code return a result set containing information about all tables, while the third call returns information about the Orders table:
SQLTables(hstmt1, NULL, 0, NULL, 0, NULL, 0, NULL, 0);
SQLTables(hstmt2, NULL, 0, NULL, 0, "%", SQL_NTS, NULL, 0);
SQLTables(hstmt3, NULL, 0, NULL, 0, "Orders", SQL_NTS, NULL, 0);
Catalog function string arguments fall into four different types: ordinary argument (OA), pattern value argument (PV), identifier argument (ID), and value list argument (VL). Most string arguments can be of one of two different types, depending on the value of the SQL_ATTR_METADATA_ID statement attribute. The following table lists the arguments for each catalog function and describes the type of the argument for an SQL_TRUE or SQL_FALSE value of SQL_ATTR_METADATA_ID.
Function | Argument | Type when SQL_ ATTR_METADATA_ ID = SQL_FALSE |
Type when SQL_ ATTR_METADATA_ ID = SQL_TRUE |
---|---|---|---|
SQLColumnPrivileges | CatalogName SchemaName TableName ColumnName | OA OA OA PV | ID ID ID ID |
SQLColumns | CatalogName SchemaName TableName ColumnName | OA PV PV PV | ID ID ID ID |
SQLForeignKeys | PKCatalogName PKSchemaName PKTableName FKCatalogName FKSchemaName FKTableName | OA OA OA OA OA OA | ID ID ID ID ID ID |
SQLPrimaryKeys | CatalogName SchemaName TableName | OA OA OA | ID ID ID |
SQLProcedureColumns | CatalogName SchemaName ProcName ColumnName | OA PV PV PV | ID ID ID ID |
SQLProcedures | CatalogName SchemaName ProcName | OA PV PV | ID ID ID |
SQLSpecialColumns | CatalogName SchemaName TableName | OA OA OA | ID ID ID |
SQLStatistics | CatalogName SchemaName TableName | OA OA OA | ID ID ID |
SQLTablePrivileges | CatalogName SchemaName TableName | OA PV PV | ID ID ID |
SQLTables | CatalogName SchemaName TableName TableType | PV PV PV VL | ID ID ID VL |
This section contains the following topics.
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Module
Use system catalogs and system views in PostgreSQL - Training
Relational databases can store vast quantities of data, but they also need to hold information about the structure of that data. For an operational database management system (DBMS) information about the structure of tables, and all other objects, security, and concurrency, amongst many other settings and metrics, is required. This information is know as metadata and is stored in system catalogs in Azure Database for PostgreSQL. In addition to directly accessing system catalogs, you can access system views