IDatabaseMetaData.GetCrossReference Method

Definition

Retrieves a description of the foreign key columns in the given foreign key table that reference the primary key or the columns representing a unique constraint of the parent table (could be the same or a different table).

[Android.Runtime.Register("getCrossReference", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;", "GetGetCrossReference_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler:Java.Sql.IDatabaseMetaDataInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Sql.IResultSet? GetCrossReference (string? parentCatalog, string? parentSchema, string? parentTable, string? foreignCatalog, string? foreignSchema, string? foreignTable);
[<Android.Runtime.Register("getCrossReference", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;", "GetGetCrossReference_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler:Java.Sql.IDatabaseMetaDataInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member GetCrossReference : string * string * string * string * string * string -> Java.Sql.IResultSet

Parameters

parentCatalog
String

a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means drop catalog name from the selection criteria

parentSchema
String

a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means drop schema name from the selection criteria

parentTable
String

the name of the table that exports the key; must match the table name as it is stored in the database

foreignCatalog
String

a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means drop catalog name from the selection criteria

foreignSchema
String

a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means drop schema name from the selection criteria

foreignTable
String

the name of the table that imports the key; must match the table name as it is stored in the database

Returns

ResultSet - each row is a foreign key column description

Attributes

Exceptions

if there is a database error.

Remarks

Retrieves a description of the foreign key columns in the given foreign key table that reference the primary key or the columns representing a unique constraint of the parent table (could be the same or a different table). The number of columns returned from the parent table must match the number of columns that make up the foreign key. They are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and KEY_SEQ.

Each foreign key column description has the following columns: <OL> <LI><B>PKTABLE_CAT</B> String => parent key table catalog (may be null) <LI><B>PKTABLE_SCHEM</B> String => parent key table schema (may be null) <LI><B>PKTABLE_NAME</B> String => parent key table name <LI><B>PKCOLUMN_NAME</B> String => parent key column name <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null) being exported (may be null) <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null) being exported (may be null) <LI><B>FKTABLE_NAME</B> String => foreign key table name being exported <LI><B>FKCOLUMN_NAME</B> String => foreign key column name being exported <LI><B>KEY_SEQ</B> short => sequence number within foreign key( a value of 1 represents the first column of the foreign key, a value of 2 would represent the second column within the foreign key). <LI><B>UPDATE_RULE</B> short => What happens to foreign key when parent key is updated: <UL> <LI> importedNoAction - do not allow update of parent key if it has been imported <LI> importedKeyCascade - change imported key to agree with parent key update <LI> importedKeySetNull - change imported key to NULL if its parent key has been updated <LI> importedKeySetDefault - change imported key to default values if its parent key has been updated <LI> importedKeyRestrict - same as importedKeyNoAction (for ODBC 2.x compatibility) </UL> <LI><B>DELETE_RULE</B> short => What happens to the foreign key when parent key is deleted. <UL> <LI> importedKeyNoAction - do not allow delete of parent key if it has been imported <LI> importedKeyCascade - delete rows that import a deleted key <LI> importedKeySetNull - change imported key to NULL if its primary key has been deleted <LI> importedKeyRestrict - same as importedKeyNoAction (for ODBC 2.x compatibility) <LI> importedKeySetDefault - change imported key to default if its parent key has been deleted </UL> <LI><B>FK_NAME</B> String => foreign key name (may be null) <LI><B>PK_NAME</B> String => parent key name (may be null) <LI><B>DEFERRABILITY</B> short => can the evaluation of foreign key constraints be deferred until commit <UL> <LI> importedKeyInitiallyDeferred - see SQL92 for definition <LI> importedKeyInitiallyImmediate - see SQL92 for definition <LI> importedKeyNotDeferrable - see SQL92 for definition </UL> </OL>

Java documentation for java.sql.DatabaseMetaData.getCrossReference(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to