OracleConnection.GetSchema 方法

定义

返回此 OracleConnection 的数据源的架构信息。Returns schema information for the data source of this OracleConnection.

重载

GetSchema()

返回此 OracleConnection 的数据源的架构信息。Returns schema information for the data source of this OracleConnection.

GetSchema(String)

通过使用架构名称的指定字符串,返回此 OracleConnection 的数据源的架构信息。Returns schema information for the data source of this OracleConnection using the specified string for the schema name.

GetSchema(String, String[])

通过使用指定字符串作为架构名称,指定字符串数组作为限制值,返回此 OracleConnection 的数据源的架构信息。Returns schema information for the data source of this OracleConnection using the specified string for the schema name and the specified string array for the restriction values.

GetSchema()

返回此 OracleConnection 的数据源的架构信息。Returns schema information for the data source of this OracleConnection.

public:
 override System::Data::DataTable ^ GetSchema();
public override System.Data.DataTable GetSchema ();
override this.GetSchema : unit -> System.Data.DataTable
Public Overrides Function GetSchema () As DataTable

返回

一个包含架构信息的 DataTableA DataTable that contains schema information.

另请参阅

GetSchema(String)

通过使用架构名称的指定字符串,返回此 OracleConnection 的数据源的架构信息。Returns schema information for the data source of this OracleConnection using the specified string for the schema name.

public:
 override System::Data::DataTable ^ GetSchema(System::String ^ collectionName);
public override System.Data.DataTable GetSchema (string collectionName);
override this.GetSchema : string -> System.Data.DataTable
Public Overrides Function GetSchema (collectionName As String) As DataTable

参数

collectionName
String

指定要返回的架构的名称。Specifies the name of the schema to return.

返回

一个包含架构信息的 DataTableA DataTable that contains schema information.

异常

collectionName 指定为 null。collectionName is specified as null.

注解

使用 GetSchema 的查询区分大小写。Queries using GetSchema are case sensitive. 由于 Oracle 在首次创建架构时处理事例,这可能会导致意外的结果。Because of Oracle's treatment of cases when a schema is first created, this can lead to unexpected results.

如果创建架构时没有用引号, 则 Oracle 会将对象名称以大写形式存储。If the schema was created without quotes, Oracle stores the object name in upper case. 如果创建的架构带有引号,Oracle 会将对象名称存储在提供的大小写中。If the schema was created with quotes, Oracle stores the object name in the casing provided.

例如,假设您使用以下两个语句之一创建一个名为 MyTable 的表:For example, suppose that you create a table called MyTable, using one of the following two statements:

CREATE TABLE MyTable ...

CREATE TABLE "MyTable" ...

若要在第一种情况下通过GetSchema方法检索有关此表的信息,则必须在中以参数形式传递 "MYTABLE"。To retrieve information about this table via the GetSchema method in the first case, you would have to pass "MYTABLE" in as an argument. 在第二种情况下,你必须将中的 "MyTable" 作为参数进行传递。In the second case, you would have to pass "MyTable" in as an argument.

另请参阅

GetSchema(String, String[])

通过使用指定字符串作为架构名称,指定字符串数组作为限制值,返回此 OracleConnection 的数据源的架构信息。Returns schema information for the data source of this OracleConnection using the specified string for the schema name and the specified string array for the restriction values.

public:
 override System::Data::DataTable ^ GetSchema(System::String ^ collectionName, cli::array <System::String ^> ^ restrictionValues);
public override System.Data.DataTable GetSchema (string collectionName, string[] restrictionValues);
override this.GetSchema : string * string[] -> System.Data.DataTable
Public Overrides Function GetSchema (collectionName As String, restrictionValues As String()) As DataTable

参数

collectionName
String

指定要返回的架构的名称。Specifies the name of the schema to return.

restrictionValues
String[]

请求的架构的一组限制值。A set of restriction values for the requested schema.

返回

一个包含架构信息的 DataTableA DataTable that contains schema information.

异常

collectionName 指定为 null。collectionName is specified as null.

注解

restrictionValues 参数可以提供 n 个值的深度,这些值由特定集合的限制集合指定。The restrictionValues parameter can supply n depth of values which are specified by the restrictions collection for a specific collection. 若要设置给定限制的值,而不设置其他限制的值,则需要将前面的限制设置为 null,然后将相应的值放在中,以确定要为其指定值的限制。In order to set values on a given restriction, and not set the values of other restrictions, you need to set the preceding restrictions to null and then put the appropriate value in for the restriction that you would like to specify a value for.

"Tables" 集合就是这样的一个示例。An example of this is the "Tables" collection. 如果 "Tables" 集合具有3个限制:数据库、所有者和表名称,则为;如果只想返回与 "Carl" 所有者关联的表,则需要传递以下值(至少): null、"Carl"。If the "Tables" collection has 3 restrictions: database, owner, and table name; and you want to get back only the tables associated with the owner "Carl", then you would need to pass in the following values (at a minimum): null, "Carl". 如果未传入限制值,则将默认值用于该限制。If a restriction value is not passed in, the default values are used for that restriction. 这与传入 null 的映射相同,这不同于为参数值传入一个空字符串。This is the same mapping as passing in null, which is different than passing in an empty string for the parameter value. 在这种情况下,空字符串("")被视为指定参数的值。In that case, the empty string ("") is considered to be the value for the specified parameter.

使用 GetSchema 的查询区分大小写。Queries using GetSchema are case sensitive. 由于 Oracle 在首次创建架构时处理事例,这可能会导致意外的结果。Because of Oracle's treatment of cases when a schema is first created, this can lead to unexpected results.

如果创建架构时没有用引号, 则 Oracle 会将对象名称以大写形式存储。If the schema was created without quotes, Oracle stores the object name in upper case. 如果创建的架构带有引号,Oracle 会将对象名称存储在提供的大小写中。If the schema was created with quotes, Oracle stores the object name in the casing provided.

例如,假设您使用以下两个语句之一创建一个名为 MyTable 的表:For example, suppose that you create a table called MyTable, using one of the following two statements:

CREATE TABLE MyTable ...

CREATE TABLE "MyTable" ...

若要在第一种情况下通过GetSchema方法检索有关此表的信息,则必须在中以参数形式传递 "MYTABLE"。To retrieve information about this table via the GetSchema method in the first case, you would have to pass "MYTABLE" in as an argument. 在第二种情况下,你必须将中的 "MyTable" 作为参数进行传递。In the second case, you would have to pass "MyTable" in as an argument.

另请参阅

适用于