IDatabaseMetaData.GetImportedKeys(String, String, String) Method

Definition

Retrieves a description of the primary key columns that are referenced by the given table's foreign key columns (the primary keys imported by a table).

[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 Java.Sql.IResultSet? GetImportedKeys (string? catalog, string? schema, string? table);
[<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")>]
abstract member GetImportedKeys : string * string * string -> Java.Sql.IResultSet

Parameters

catalog
String

a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search

schema
String

a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the search

table
String

a table name; must match the table name as it is stored in the database

Returns

ResultSet - each row is a primary key column description

Attributes

Exceptions

a database error occurred.

Remarks

Retrieves a description of the primary key columns that are referenced by the given table's foreign key columns (the primary keys imported by a table). They are ordered by PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, and KEY_SEQ.

Each primary key column description has the following columns: <OL> <LI><B>PKTABLE_CAT</B> String => primary key table catalog being imported (may be null) <LI><B>PKTABLE_SCHEM</B> String => primary key table schema being imported (may be null) <LI><B>PKTABLE_NAME</B> String => primary key table name being imported <LI><B>PKCOLUMN_NAME</B> String => primary key column name being imported <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null) <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null) <LI><B>FKTABLE_NAME</B> String => foreign key table name <LI><B>FKCOLUMN_NAME</B> String => foreign key column name <LI><B>KEY_SEQ</B> short => sequence number within a 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 a foreign key when the primary key is updated: <UL> <LI> importedNoAction - do not allow update of primary key if it has been imported <LI> importedKeyCascade - change imported key to agree with primary key update <LI> importedKeySetNull - change imported key to NULL if its primary key has been updated <LI> importedKeySetDefault - change imported key to default values if its primary 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 primary is deleted. <UL> <LI> importedKeyNoAction - do not allow delete of primary 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 primary key has been deleted </UL> <LI><B>FK_NAME</B> String => foreign key name (may be null) <LI><B>PK_NAME</B> String => primary 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.getImportedKeys(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