From f5742726773f6c40ffc750dd7833e4aa434916e0 Mon Sep 17 00:00:00 2001 From: Andreas Karajannis Date: Sun, 28 May 2000 17:22:15 +0000 Subject: [PATCH] Added documentation for various odbc metadata functions git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@25187 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/uodbc.xml | 587 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 579 insertions(+), 8 deletions(-) diff --git a/functions/uodbc.xml b/functions/uodbc.xml index 4386c57227..9bb46fc834 100644 --- a/functions/uodbc.xml +++ b/functions/uodbc.xml @@ -432,7 +432,6 @@ - @@ -478,7 +476,7 @@ odbc_field_len - get the Length of a field + get the length (precision) of a field Description @@ -491,10 +489,53 @@ odbc_field_len will return the length of the field referecend by number in the given ODBC result identifier. Field numbering starts at 1. - + + See also: odbc_field_scale to get the scale of a + floating point number. + + + + odbc_field_precision + synonym for odbc_field_len + + + Description + + string odbc_field_precision + int result_id + int field_number + + + odbc_field_precision will return the precision + of the field referecend by number in the given ODBC result + identifier. + See also: odbc_field_scale to get the scale of a + floating point number. + + + + + + + odbc_field_scale + get the scale of a field + + + Description + + string odbc_field_scale + int result_id + int field_number + + + odbc_field_precision will return the scale + of the field referecend by number in the given ODBC result + identifier. + + @@ -814,10 +855,540 @@ odbc_setoption ($conn, 1, 102, 1); $result = odbc_prepare ($conn, $sql); odbc_setoption ($result, 2, 0, 30); odbc_execute ($result); - - - - + + + + + + + + odbc_tables + Get the list of table names stored in a specific data source. + Returns a result identifier containing the information. + + + Description + + int odbc_tables + int connection_id + string qualifier + string owner + string name + string types + + + Lists all tables in the requested range. Returns an ODBC result identifier or + false on failure. + + The result set has the following columns: + + TABLE_QUALIFIER + TABLE_OWNER + TABLE_NAME + TABLE_TYPE + REMARKS + + + The result set is ordered by TABLE_TYPE, TABLE_QUALIFIER, TABLE_OWNER + and TABLE_NAME. + + The owner and name arguments accept + search patterns ('%' to match zero or more characters and '_' to match a single + character). + + To support enumeration of qualifiers, owners, and table types, the following special + semantics for the qualifier, owner, + name, and table_type are + available: + + + If qualifier is a single percent character (%) + and owner and name are empty + strings, then the result set contains a list of valid qualifiers for the + data source. (All columns except the TABLE_QUALIFIER column contain + NULLs.) + + + If owner is a single percent character (%) + and qualifier and name are + empty strings, then the result set contains a list of valid owners for + the data source. (All columns except the TABLE_OWNER column contain + NULLs.) + + + If table_type is a single percent character + (%) and qualifier, owner and + name are empty strings, then the result set contains + a list of valid table types for the data source. (All columns except the + TABLE_TYPE column contain NULLs.) + + + + If table_type is not an empty string, it must contain a list + of comma-separated values for the types of interest; each value may be enclosed in + single quotes (') or unquoted. For example, "'TABLE','VIEW'" or "TABLE, VIEW". + If the data source does not support a specified table type, + odbc_tables does not return any results for that type. + + + See also odbc_tableprivileges to retrieve associated + privileges. + + + + + + + + odbc_tableprivileges + Lists tables and the privileges associated with each table. + + + Description + + int odbc_tableprivileges + int connection_id + string qualifier + string owner + string name + + + Lists tables in the requested range and the privileges associated with each table. + Returns an ODBC result identifier or false on failure. + + The result set has the following columns: + + TABLE_QUALIFIER + TABLE_OWNER + TABLE_NAME + GRANTOR + GRANTEE + PRIVILEGE + IS_GRANTABLE + + + The result set is ordered by TABLE_QUALIFIER, TABLE_OWNER + and TABLE_NAME. + + The owner and name arguments accept + search patterns ('%' to match zero or more characters and '_' to match a single + character). + + + + + + + odbc_columns + Lists the column names in specified tables. Returns a result + identifier containing the information. + + + Description + + int odbc_columns + int connection_id + string qualifier + string owner + string table_name + string column_name + + + Lists all columns in the requested range. Returns an ODBC result identifier or + false on failure. + + The result set has the following columns: + + TABLE_QUALIFIER + TABLE_OWNER + TABLE_NAME + COLUMN_NAME + DATA_TYPE + TYPE_NAME + PRECISION + LENGTH + SCALE + RADIX + NULLABLE + REMARKS + + + The result set is ordered by TABLE_QUALIFIER, TABLE_OWNER + and TABLE_NAME. + + The owner, table_name and + column_name arguments accept search patterns + ('%' to match zero or more characters and '_' to match a single character). + + + See also odbc_columnprivileges to retrieve associated + privileges + + + + + + + odbc_columnprivileges + Returns a result identifier that can be used to fetch a list of columns and associated + privileges + + + Description + + int odbc_columnprivileges + int connection_id + string qualifier + string owner + string table_name + string column_name + + + Lists columns and associated privileges for the given table. + Returns an ODBC result identifier or false on failure. + + The result set has the following columns: + + TABLE_QUALIFIER + TABLE_OWNER + TABLE_NAME + GRANTOR + GRANTEE + PRIVILEGE + IS_GRANTABLE + + + The result set is ordered by TABLE_QUALIFIER, TABLE_OWNER + and TABLE_NAME. + + The column_name argument accepts + search patterns ('%' to match zero or more characters and '_' to match a single + character). + + + + + + + odbc_gettypeinfo + Returns a result identifier containing information about data + types supported by the data source. + + + + Description + + int odbc_gettypeinfo + int connection_id + int data_type + + + Retrieves information about data types supported by the data source. + Returns an ODBC result identifier or false on failure. + The optional argument data_type can be used to restrict + the information to a single data type. + + + The result set has the following columns: + + TYPE_NAME + DATA_TYPE + PRECISION + LITERAL_PREFIX + LITERAL_SUFFIX + CREATE_PARAMS + NULLABLE + CASE_SENSITIVE + SEARCHABLE + UNSIGNED_ATTRIBUTE + MONEY + AUTO_INCREMENT + LOCAL_TYPE_NAME + MINIMUM_SCALE + MAXIMUM_SCALE + + + The result set is ordered by DATA_TYPE and TYPE_NAME. + + + + + + + odbc_primarykeys + + + + Description + Returns a result identifier that can be used to fetch the column + names that comprise the primary key for a table + int odbc_primarykeys + int connection_id + string qualifier + string owner + string table + + + Returns the column names that comprise the primary key for a table. + Returns an ODBC result identifier or false on failure. + + + The result set has the following columns: + + TABLE_QUALIFIER + TABLE_OWNER + TABLE_NAME + COLUMN_NAME + KEY_SEQ + PK_NAME + + + + + + + + odbc_foreignkeys + Returns a list of foreign keys in the specified table + or a list of foreign keys in other tables that + refer to the primary key in the specified table + + + + Description + + int odbc_foreignkeys + int connection_id + string pk_qualifier + string pk_owner + string pk_table + string fk_qualifier + string fk_owner + string fk_table + + + odbc_foreignkeys retrieves information about + foreign keys. Returns an ODBC result identifier or false + on failure. + + + The result set has the following columns: + + PKTABLE_QUALIFIER + PKTABLE_OWNER + PKTABLE_NAME + PKCOLUMN_NAME + FKTABLE_QUALIFIER + FKTABLE_OWNER + FKTABLE_NAME + FKCOLUMN_NAME + KEY_SEQ + UPDATE_RULE + DELETE_RULE + FK_NAME + PK_NAME + + + If pk_table contains a table name, + odbc_foreignkeys returns a result set containing + the primary key of the specified table and all of the foreign keys that + refer to it. + + If fk_table contains a table name, + odbc_foreignkeys returns a result set containing + all of the foreign keys in the specified table and the primary keys + (in other tables) to which they refer. + + + If both pk_table and fk_table + contain table names, odbc_foreignkeys returns the + foreign keys in the table specified in fk_table + that refer to the primary key of the table specified in + pk_table. This should be one key at most. + + + + + + + + odbc_procedures + Get the list of procedures stored in a specific data source. + Returns a result identifier containing the information. + + + Description + + int odbc_procedures + int connection_id + string qualifier + string owner + string name + + Lists all procedures in the requested range. Returns an ODBC result + identifier or false on failure. + + + The result set has the following columns: + + PROCEDURE_QUALIFIER + PROCEDURE_OWNER + PROCEDURE_NAME + NUM_INPUT_PARAMS + NUM_OUTPUT_PARAMS + NUM_RESULT_SETS + REMARKS + PROCEDURE_TYPE + + + + The owner and name arguments accept + search patterns ('%' to match zero or more characters and '_' to match a single + character). + + + + + + + odbc_procedurecolumns + Retrieve information about parameters to procedures + + + Description + + int odbc_procedurecolumns + int connection_id + string qualifier + string owner + string proc + string column + + + Returns the list of input and output parameters, as well as the + columns that make up the result set for the specified procedures. Returns + an ODBC result identifier or false on failure. + + + The result set has the following columns: + + PROCEDURE_QUALIFIER + PROCEDURE_OWNER + PROCEDURE_NAME + COLUMN_NAME + COLUMN_TYPE + DATA_TYPE + TYPE_NAME + PRECISION + LENGTH + SCALE + RADIX + NULLABLE + REMARKS + + + The result set is ordered by PROCEDURE_QUALIFIER, PROCEDURE_OWNER, + PROCEDURE_NAME and COLUMN_TYPE. + + + The owner, proc and + column arguments accept search patterns + ('%' to match zero or more characters and '_' to match a single character). + + + + + + + odbc_specialcolumns + Returns either the optimal set of columns that uniquely identifies + a row in the table or columns that are automatically updated when any value + in the row is updated by a transaction + + + Description + + int odbc_specialcolumns + int connection_id + int type + string qualifier + string owner + string table + int scope + int nullable + + + When the type argument is SQL_BEST_ROWID, + odbc_specialcolumns returns the + column or columns that uniquely identify each row in the table. + + + When the type argument is SQL_ROWVER, + odbc_specialcolumns returns the + optimal column or set of columns that, by retrieving values from + the column or columns, allows any row in the specified table to be + uniquely identified. + + Returns an ODBC result identifier or false on failure. + + + The result set has the following columns: + + SCOPE + COLUMN_NAME + DATA_TYPE + TYPE_NAME + PRECISION + LENGTH + SCALE + PSEUDO_COLUMN + + + The result set is ordered by SCOPE + + + + + + odbc_statistics + Retrieve statistics about a table + + + Description + + int odbc_statistics + int connection_id + string qualifier + string owner + string table_name + int unique + int accuracy + + Get statistics about a table and it's inexes. Returns an ODBC + result identifier or false on failure. + + The result set has the following columns: + + TABLE_QUALIFIER + TABLE_OWNER + TABLE_NAME + NON_UNIQUE + INDEX_QUALIFIER + INDEX_NAME + TYPE + SEQ_IN_INDEX + COLUMN_NAME + COLLATION + CARDINALITY + PAGES + FILTER_CONDITION + + + The result set is ordered by NON_UNIQUE, TYPE, INDEX_QUALIFIER, + INDEX_NAME and SEQ_IN_INDEX. + + +