Java.Sql.IDatabaseMetaData.GetCrossReference Method
Returns a list of foreign key columns in a given foreign key table that reference the primary key columns of a supplied primary key table.

Syntax

[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 IResultSet GetCrossReference (string primaryCatalog, string primarySchema, string primaryTable, string foreignCatalog, string foreignSchema, string foreignTable)

Parameters

primaryCatalog
a catalog name for the primary key table. null is used to imply no narrowing of the search by catalog name. Otherwise, the name must match a catalog name held in the database, with "" used to retrieve those without a catalog name.
primarySchema
a schema name for the primary key table. null is used to imply no narrowing of the search by schema name. Otherwise, the name must match a schema name in the database, with "" used to retrieve those without a schema name.
primaryTable
the name of the table which exports the key. It must match the name of the table in the database.
foreignCatalog
a catalog name for the foreign key table. null is used to imply no narrowing of the search by catalog name. Otherwise, the name must match a catalog name held in the database, with "" used to retrieve those without a catalog name.
foreignSchema
a schema name for the foreign key table. null is used to imply no narrowing of the search by schema name. Otherwise, the name must match a schema name in the database, with "" used to retrieve those without a schema name.
foreignTable
the name of the table importing the key. It must match the name of the table in the database.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Sql.SQLExceptionif there is a database error.

Remarks

Returns a list of foreign key columns in a given foreign key table that reference the primary key columns of a supplied primary key table. This describes how one table imports the key of another table. It would be expected to return a single foreign key - primary key pair in most cases.

The descriptions are returned as a ResultSet with one row for each foreign key, with the following layout:

  1. PKTABLE_CAT - String - from the primary key table : Catalog (possibly null)
  2. PKTABLE_SCHEM - String - from the primary key table : Schema (possibly null)
  3. PKTABLE_NAME - String - from the primary key table : name
  4. PKCOLUMN_NAME - String - from the primary key column : name
  5. FKTABLE_CAT - String - from the foreign key table : the catalog name being exported (possibly null)
  6. FKTABLE_SCHEM - String - from the foreign key table : the schema name being exported (possibly null)
  7. FKTABLE_NAME - String - from the foreign key table : the name being exported
  8. FKCOLUMN_NAME - String - from the foreign key column : the name being exported
  9. KEY_SEQ - short - the sequence number (in the foreign key)
  10. UPDATE_RULE - short - a value giving the rule for how to treat the corresponding foreign key when a primary key is updated:
    • DatabaseMetaData.importedKeyNoAction - don't allow the primary key to be updated if it is imported as a foreign key
    • DatabaseMetaData.importedKeyCascade - change the imported key to match the updated primary key
    • DatabaseMetaData.importedKeySetNull - set the imported key to null
    • DatabaseMetaData.importedKeySetDefault - set the imported key to its default value
    • DatabaseMetaData.importedKeyRestrict - same as importedKeyNoAction
    • DELETE_RULE - short - a value giving the rule for how to treat the foreign key when the corresponding primary key is deleted:
      • DatabaseMetaData.importedKeyNoAction - don't allow the primary key to be deleted if it is imported as a foreign key
      • DatabaseMetaData.importedKeyCascade - delete those rows that import a deleted key
      • DatabaseMetaData.importedKeySetNull - set the imported key to null
      • DatabaseMetaData.importedKeySetDefault - set the imported key to its default value
      • DatabaseMetaData.importedKeyRestrict - same as importedKeyNoAction
      • FK_NAME - String - the foreign key name (possibly null)
      • PK_NAME - String - the primary key name (possibly null)
      • DEFERRABILITY - short - whether foreign key constraints can be deferred until commit (see the SQL92 specification for definitions):
        • DatabaseMetaData.importedKeyInitiallyDeferred
        • DatabaseMetaData.importedKeyInitiallyImmediate
        • DatabaseMetaData.importedKeyNotDeferrable

        [Android Documentation]

        Requirements

        Namespace: Java.Sql
        Assembly: Mono.Android (in Mono.Android.dll)
        Assembly Versions: 0.0.0.0
        Since: Added in API level 1