Java.Sql.IDatabaseMetaData.GetImportedKeys Method
Returns a list columns in a table that are both primary keys and referenced by the table's foreign key columns (that is, the primary keys imported by a table).

Syntax

[Android.Runtime.Register("getImportedKeys", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;", "GetGetImportedKeys_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 GetImportedKeys (string catalog, string schema, string table)

Parameters

catalog
a catalog name. 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.
schema
a schema name. 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.
table
a table name, which must match the name of a table in the database.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Sql.SQLExceptiona database error occurred.

Remarks

Returns a list columns in a table that are both primary keys and referenced by the table's foreign key columns (that is, the primary keys imported by a table).

The list returned is a ResultSet with a row entry for each primary key column, ordered by PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, and KEY_SEQ, with the following format:

  1. PKTABLE_CAT - String - primary key catalog name being imported (possibly null)
  2. PKTABLE_SCHEM - String - primary key schema name being imported (possibly null)
  3. PKTABLE_NAME - String - primary key table name being imported
  4. PKCOLUMN_NAME - String - primary key column name being imported
  5. FKTABLE_CAT - String - foreign key table catalog name (possibly null)
  6. FKTABLE_SCHEM - String - foreign key table schema name (possibly null)
  7. FKTABLE_NAME - String - foreign key table name
  8. FKCOLUMN_NAME - String - foreign key column name
  9. KEY_SEQ - short - sequence number (in the foreign key)
  10. UPDATE_RULE - short - how to treat the foreign key when the corresponding primary key is updated:
    • DatabaseMetaData.importedKeyNoAction - don't allow any update of the primary key if it is imported as a foreign key
    • DatabaseMetaData.importedKeyCascade - change imported key to match the primary key update
    • 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 - 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 - foreign key name (possibly null)
      • PK_NAME - String - primary key name (possibly null)
      • DEFERRABILITY - short - defines whether foreign key constraints can be deferred until commit (see 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