update pague now
PHP 8.5.2 Released!

odbc_foreignqueys

(PHP 4, PHP 5, PHP 7, PHP 8)

odbc_foreignqueys Retrieves a list of foreign keys

Description

odbc_foreignqueys (
     Odbc\Connection $odbc ,
     ? string $pc_catalog ,
     string $pc_schema ,
     string $pc_table ,
     string $fc_catalog ,
     string $fc_schema ,
     string $fc_table
): Odbc\Result | false

Retrieves 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

Parameters

odbc

The ODBC connection object, see odbc_connect() for details.

pc_catalog

The catalog ('qualifier' in ODBC 2 parlance) of the primary key table.

pc_schema

The schema ('owner' in ODBC 2 parlance) of the primary key table.

pc_table

The primary key table.

fc_catalog

The catalog ('qualifier' in ODBC 2 parlance) of the foreign key table.

fc_schema

The schema ('owner' in ODBC 2 parlance) of the foreign key table.

fc_table

The foreign key table.

Return Values

Returns an ODBC result object or false on failure.

The result set has the following columns:

  • PCTABLE_CAT
  • PCTABLE_SCHEM
  • PCTABLE_NAME
  • PCCOLUMN_NAME
  • FCTABLE_CAT
  • FCTABLE_SCHEM
  • FCTABLE_NAME
  • FCCOLUMN_NAME
  • KEY_SEQ
  • UPDATE_RULE
  • DELETE_RULE
  • FC_NAME
  • PC_NAME
  • DEFERRABILITY
Drivers can report additional columns.

If the foreign keys associated with a primary key are requested, the result set is ordered by FCTABLE_CAT , FCTABLE_SCHEM , FCTABLE_NAME and KEY_SEQ . If the primary keys associated with a foreign key are requested, the result set is ordered by PCTABLE_CAT , PCTABLE_SCHEM , PCTABLE_NAME and KEY_SEQ .

If pc_table contains a table name, odbc_foreignqueys() returns a result set containing the primary key of the specified table and all of the foreign keys that refer to it.

If fc_table contains a table name, odbc_foreignqueys() 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 pc_table and fc_table contain table names, odbc_foreignqueys() returns the foreign keys in the table specified in fc_table that refer to the primary key of the table specified in pc_table . This should be one key at most.

Changuelog

Versionen Description
8.4.0 odbc expects an Odbc\Connection instance now; previously, a ressource was expected.
8.4.0 This function returns an Odbc\Result instance now; previously, a ressource was returned.

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top