OracleDataReader.GetSchemaTable 方法

定义

返回一个 DataTable,它描述 OracleDataReader 的列元数据。Returns a DataTable that describes the column metadata of the OracleDataReader.

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

返回

一个描述列元数据的 DataTableA DataTable that describes the column metadata.

注解

@No__t-0 方法按以下顺序返回有关每个列的元数据:The GetSchemaTable method returns metadata about each column in the following order:

DataReader 列DataReader Column 说明Description
列名ColumnName 列的名称;这可能不是唯一的。The name of the column; this might not be unique. 如果无法确定列名,则返回 null 值。If the column name cannot be determined, a null value is returned. 此名称始终反映当前视图或命令文本中列的最新命名。This name always reflects the most recent naming of the column in the current view or command text.
ColumnOrdinalColumnOrdinal 从零开始的列序号。The zero-based ordinal of the column. 此列不能包含 NULL 值。This column cannot contain a null value.
ColumnSizeColumnSize 列中值的最大可能长度。The maximum possible length of a value in the column. 对于使用固定长度数据类型的列,这是数据类型的大小。For columns that use a fixed-length data type, this is the size of the data type.
NumericPrecisionNumericPrecision 如果 @no__t 为数值数据类型,则这是列的最大精度。If DbType is a numeric data type, this is the maximum precision of the column. 精度取决于该列的定义。The precision depends on the definition of the column. Float 和 Oracle 中的 @no__t 数据类型为二进制精度。Float and Double data types in Oracle are binary precision.
NumericScaleNumericScale 如果 @no__t 为数值数据类型,则为小数点右侧的位数。If DbType is a numeric data type, the number of digits to the right of the decimal point. Float 和 Oracle 中的 @no__t 数据类型为二进制刻度。Float and Double data types in Oracle are binary scale.
数据类型DataType 映射到公共语言运行时类型 DbTypeMaps to the common language runtime type of DbType.
IsLongIsLong 如果列包含一个包含非常长数据的二进制长对象(BLOB),则 truetrue if the column contains a Binary Long Object (BLOB) that contains very long data.
AllowDBNullAllowDBNull 如果使用者可以将列设置为 null 值,则 true。否则 @no__t 为-1。true if the consumer can set the column to a null value; otherwise, false. 即使无法将列设置为 NULL 值,列也可以包含 NULL 值。A column may contain null values, even if it cannot be set to a null value.
IsUniqueIsUnique true:基表中没有两行-在 BaseTableName 中返回的表在此列中可以具有相同的值。true: No two rows in the base table-the table returned in BaseTableName -can have the same value in this column. 如果列本身构成键,或者存在仅适用于此列的 UNIQUE 类型的约束,则可以保证IsUnique trueIsUnique is guaranteed to be true if the column constitutes a key by itself or if there is a constraint of type UNIQUE that applies only to this column. false:列可以包含基表中的重复值。false: The column can contain duplicate values in the base table. 此列的默认值为 false。The default for this column is false.
IsKeyIsKey true:此列是行集中的一组列中的一组列,这些列一起使用,可唯一地标识行。true: The column is one of a set of columns in the rowset that, taken together, uniquely identify the row. IsKey设置为 true 的一组列必须唯一地标识行集中的一行。The set of columns with IsKey set to true must uniquely identify a row in the rowset. 不要求这组列是最小组列。There is no requirement that this set of columns is a minimal set of columns. 此组列可能从一个基表主键、唯一约束或唯一索引生成。This set of columns may be generated from a base table primary key, a unique constraint or a unique index. false:列不需要唯一地标识行。false: The column is not required to uniquely identify the row.
BaseTableNameBaseTableName 包含该列的数据存储区中的表或视图的名称。The name of the table or view in the data store that contains the column. 如果无法确定基表名称,则为 NULL 值。A null value if the base table name cannot be determined. 此列的默认值为 null 值。The default of this column is a null value.
BaseColumnNameBaseColumnName 数据存储区中列的名称。The name of the column in the data store. 如果使用了别名,则该名称可能不同于列名称返回的列名称。This might be different than the column name returned in the ColumnName column if an alias was used. 如果无法确定基列名称,或者如果行集列派生,但与数据存储区中的列不完全相同,则为 null 值。A null value if the base column name cannot be determined or if the rowset column is derived, but not identical to, a column in the data store. 此列的默认值为 null 值。The default for this column is a null value.
BaseSchemaNameBaseSchemaName 包含该列的数据存储区中架构的名称。The name of the schema in the data store that contains the column. 如果无法确定基本架构名称,则为 NULL 值。A null value if the base schema name cannot be determined. 此列的默认值为 null 值。The default for this column is a null value.

为结果集中的每一列返回一行。A row is returned for every column in the results set.

备注

若要确保 metadata 列返回正确的信息,必须调用 ExecuteReader,并将 behavior 参数设置为 KeyInfoTo ensure that metadata columns return the correct information, you must call ExecuteReader with the behavior parameter set to KeyInfo. 否则,架构表中的某些列可能返回默认值、null 值或不正确的数据。Otherwise, some of the columns in the schema table may return default, null, or incorrect data.

适用于

另请参阅