odbc_sys/desc.rs
1/// Used in `SQLColAttributeW`.
2#[repr(u16)]
3#[derive(Debug, PartialEq, Eq, Clone, Copy)]
4pub enum Desc {
5 /// `SQL_DESC_COUNT`. Returned in `NumericAttributePtr`. The number of columns available in the
6 /// result set. This returns 0 if there are no columns in the result set. The value in the
7 /// `column_number` argument is ignored.
8 Count = 1001,
9 /// `SQL_DESC_TYPE`. Retruned in `NumericAttributePtr`. A numeric value that specifies the SQL
10 /// data type. When ColumnNumber is equal to 0, SQL_BINARY is returned for variable-length
11 /// bookmarks and SQL_INTEGER is returned for fixed-length bookmarks. For the datetime and
12 /// interval data types, this field returns the verbose data type: SQL_DATETIME or SQL_INTERVAL.
13 /// Note: To work against ODBC 2.x drivers, use `SQL_DESC_CONCISE_TYPE` instead.
14 Type = 1002,
15 /// `SQL_DESC_LENGTH`. Returned in `NumericAttributePtr`. A numeric value that is either the
16 /// maximum or actual character length of a character string or binary data type. It is the
17 /// maximum character length for a fixed-length data type, or the actual character length for a
18 /// variable-length data type. Its value always excludes the null-termination byte that ends the
19 /// character string.
20 Length = 1003,
21 /// `SQL_DESC_OCTET_LENGTH_PTR`.
22 OctetLengthPtr = 1004,
23 /// `SQL_DESC_PRECISION`. Returned in `NumericAttributePtr`. A numeric value that for a numeric
24 /// data type denotes the applicable precision. For data types SQL_TYPE_TIME,
25 /// SQL_TYPE_TIMESTAMP, and all the interval data types that represent a time interval, its
26 /// value is the applicable precision of the fractional seconds component.
27 Precision = 1005,
28 /// `SQL_DESC_SCALE`. Returned in `NumericAttributePtr`. A numeric value that is the applicable
29 /// scale for a numeric data type. For DECIMAL and NUMERIC data types, this is the defined
30 /// scale. It is undefined for all other data types.
31 Scale = 1006,
32 /// `SQL_DESC_DATETIME_INTERVAL_CODE`.
33 DatetimeIntervalCode = 1007,
34 /// `SQL_DESC_NULLABLE`. Returned in `NumericAttributePtr`. `SQL_ NULLABLE` if the column can
35 /// have NULL values; SQL_NO_NULLS if the column does not have NULL values; or
36 /// SQL_NULLABLE_UNKNOWN if it is not known whether the column accepts NULL values.
37 Nullable = 1008,
38 /// `SQL_DESC_INDICATOR_PTR`
39 IndicatorPtr = 1009,
40 /// `SQL_DESC_DATA_PTR`.
41 DataPtr = 1010,
42 /// `SQL_DESC_NAME`. Returned in `CharacterAttributePtr`. The column alias, if it applies. If
43 /// the column alias does not apply, the column name is returned. In either case,
44 /// SQL_DESC_UNNAMED is set to SQL_NAMED. If there is no column name or a column alias, an empty
45 /// string is returned and SQL_DESC_UNNAMED is set to SQL_UNNAMED.
46 Name = 1011,
47 /// `SQL_DESC_UNNAMED`. Returned in `NumericAttributePtr`. SQL_NAMED or SQL_UNNAMED. If the
48 /// SQL_DESC_NAME field of the IRD contains a column alias or a column name, SQL_NAMED is
49 /// returned. If there is no column name or column alias, SQL_UNNAMED is returned.
50 Unnamed = 1012,
51 /// `SQL_DESC_OCTET_LENGTH`. Returned in `NumericAttributePtr`. The length, in bytes, of a
52 /// character string or binary data type. For fixed-length character or binary types, this is
53 /// the actual length in bytes. For variable-length character or binary types, this is the
54 /// maximum length in bytes. This value does not include the null terminator.
55 OctetLength = 1013,
56 /// `SQL_DESC_ALLOC_TYPE`.
57 AllocType = 1099,
58 #[cfg(feature = "odbc_version_4")]
59 /// `SQL_DESC_CHARACTER_SET_CATALOG`.
60 CharacterSetCatalog = 1018,
61 #[cfg(feature = "odbc_version_4")]
62 /// `SQL_DESC_CHARACTER_SET_SCHEMA`
63 CharacterSetSchema = 1019,
64 #[cfg(feature = "odbc_version_4")]
65 // `SQL_DESC_CHARACTER_SET_NAME`.
66 #[cfg(feature = "odbc_version_4")]
67 CharacterSetName = 1020,
68 #[cfg(feature = "odbc_version_4")]
69 /// `SQL_DESC_COLLATION_CATALOG`
70 CollationCatalog = 1015,
71 #[cfg(feature = "odbc_version_4")]
72 /// `SQL_DESC_COLLATION_SCHEMA`
73 CollationSchema = 1016,
74 #[cfg(feature = "odbc_version_4")]
75 /// `SQL_DESC_COLLATION_NAME`
76 CollationName = 1017,
77 #[cfg(feature = "odbc_version_4")]
78 /// `SQL_DESC_USER_DEFINED_TYPE_CATALOG`
79 UserDefinedTypeCatalog = 1026,
80 #[cfg(feature = "odbc_version_4")]
81 /// `SQL_DESC_USER_DEFINED_TYPE_SCHEMA`.
82 UserDefinedTypeSchema = 1027,
83 #[cfg(feature = "odbc_version_4")]
84 /// `SQL_DESC_USER_DEFINED_TYPE_NAME`.
85 UserDefinedTypeName = 1028,
86
87 // Extended Descriptors
88 /// `SQL_DESC_ARRAY_SIZE`
89 ArraySize = 20,
90 /// `SQL_DESC_ARRAY_STATUS_PTR`
91 ArrayStatusPtr = 21,
92 /// `SQL_DESC_AUTO_UNIQUE_VALUE`. Returned in `NumericAttributePtr`. `true` if the column is an
93 /// autoincrementing column. `false` if the column is not an autoincrementing column or is not
94 /// numeric. This field is valid for numeric data type columns only. An application can insert
95 /// values into a row containing an autoincrement column, but typically cannot update values in
96 /// the column. When an insert is made into an autoincrement column, a unique value is inserted
97 /// into the column at insert time. The increment is not defined, but is data source-specific.
98 /// An application should not assume that an autoincrement column starts at any particular point
99 /// or increments by any particular value.
100 AutoUniqueValue = 11,
101 /// `SQL_DESC_BASE_COLUMN_NAME`. Returned in `CharacterAttributePtr`. The base column name for
102 /// the result set column. If a base column name does not exist (as in the case of columns that
103 /// are expressions), then this variable contains an empty string.
104 BaseColumnName = 22,
105 /// `SQL_DESC_BASE_TABLE_NAME`. Returned in `CharacterAttributePtr`. The name of the base table
106 /// that contains the column. If the base table name cannot be defined or is not applicable,
107 /// then this variable contains an empty string.
108 BaseTableName = 23,
109 /// `SQL_DESC_BIND_OFFSET_PTR`.
110 BindOffsetPtr = 24,
111 /// `SQL_DESC_BIND_TYPE`.
112 BindType = 25,
113 /// `SQL_DESC_CASE_SENSITIVE`. Returned in `NumericAttributePtr`. `true` if the column is
114 /// treated as case-sensitive for collations and comparisons. `false` if the column is not
115 /// treated as case-sensitive for collations and comparisons or is noncharacter.
116 CaseSensitive = 12,
117 /// `SQL_DESC_CATALOG_NAME`. Returned in `CharacterAttributePtr`. The catalog of the table that
118 /// contains the column. The returned value is implementation-defined if the column is an
119 /// expression or if the column is part of a view. If the data source does not support catalogs
120 /// or the catalog name cannot be determined, an empty string is returned. This VARCHAR record
121 /// field is not limited to 128 characters.
122 CatalogName = 17,
123 /// `SQL_DESC_CONCISE_TYPE`. Returned in `NumericAttributePtr`. The concise data type. For the
124 /// datetime and interval data types, this field returns the concise data type; for example,
125 /// SQL_TYPE_TIME or SQL_INTERVAL_YEAR.
126 ConciseType = 2,
127 /// `SQL_DESC_DATETIME_INTERVAL_PRECISION`
128 DatetimeIntervalPrecision = 26,
129 /// `SQL_DESC_DISPLAY_SIZE`. Returned in `NumericAttributePtr`. Maximum number of characters
130 /// required to display data from the column.
131 DisplaySize = 6,
132 /// `SQL_DESC_FIXED_PREC_SCALE`. Returned in `NumericAttributePtr`. `true` if the column has a
133 /// fixed precision and nonzero scale that are data source-specific. `false` if the column does
134 /// not have a fixed precision and nonzero scale that are data source-specific.
135 FixedPrecScale = 9,
136 /// `SQL_DESC_LABEL`. Returned in `CharacterAttributePtr`. The column label or title. For
137 /// example, a column named EmpName might be labeled Employee Name or might be labeled with an
138 /// alias. If a column does not have a label, the column name is returned. If the column is
139 /// unlabeled and unnamed, an empty string is returned.
140 Label = 18,
141 /// `SQL_DESC_LITERAL_PREFIX`. Returned in `CharacterAttributePtr`. This VARCHAR(128) record
142 /// field contains the character or characters that the driver recognizes as a prefix for a
143 /// literal of this data type. This field contains an empty string for a data type for which a
144 /// literal prefix is not applicable.
145 LiteralPrefix = 27,
146 /// `SQL_DESC_LITERAL_SUFFIX`. Returned in `CharacterAttributePtr`. This VARCHAR(128) record
147 /// field contains the character or characters that the driver recognizes as a suffix for a
148 /// literal of this data type. This field contains an empty string for a data type for which a
149 /// literal suffix is not applicable.
150 LiteralSuffix = 28,
151 /// `SQL_DESC_LOCAL_TYPE_NAME`. Returned in `CharacterAttributePtr`. This VARCHAR(128) record
152 /// field contains any localized (native language) name for the data type that may be different
153 /// from the regular name of the data type. If there is no localized name, then an empty string
154 /// is returned. This field is for display purposes only. The character set of the string is
155 /// locale-dependent and is typically the default character set of the server.
156 LocalTypeName = 29,
157 /// `SQL_DESC_MAXIMUM_SCALE`.
158 MaximumScale = 30,
159 /// `SQL_DESC_MINIMUM_SCALE`.
160 MinimumScale = 31,
161 /// `SQL_DESC_NUM_PREC_RADIX`. Returned in `NumericAttributePtr`. If the data type in the
162 /// SQL_DESC_TYPE field is an approximate numeric data type, this SQLINTEGER field contains a
163 /// value of 2 because the SQL_DESC_PRECISION field contains the number of bits. If the data
164 /// type in the SQL_DESC_TYPE field is an exact numeric data type, this field contains a value
165 /// of 10 because the SQL_DESC_PRECISION field contains the number of decimal digits. This field
166 /// is set to 0 for all non-numeric data types.
167 NumPrecRadix = 32,
168 /// `SQL_DESC_PARAMETER_TYPE`.
169 ParameterType = 33,
170 /// `SQL_DESC_ROWS_PROCESSED_PTR`.
171 RowsProcessedPtr = 34,
172 #[cfg(feature = "odbc_version_3_50")]
173 /// `SQL_DESC_ROWVER`.
174 RowVer = 35,
175 /// `SQL_DESC_SCHEMA_NAME`. Returned in `CharacterAttributePtr`. The schema of the table that
176 /// contains the column. The returned value is implementation-defined if the column is an
177 /// expression or if the column is part of a view. If the data source does not support schemas
178 /// or the schema name cannot be determined, an empty string is returned. This VARCHAR record
179 /// field is not limited to 128 characters.
180 SchemaName = 16,
181 /// `SQL_DESC_SEARCHABLE`. Returned in `NumericAttributePtr`. `SQL_PRED_NONE` if the column
182 /// cannot be used in a WHERE clause. `SQL_PRED_CHAR` if the column can be used in a WHERE
183 /// clause but only with the LIKE predicate. `SQL_PRED_BASIC` if the column can be used in a
184 /// WHERE clause with all the comparison operators except LIKE. `SQL_PRED_SEARCHABLE` if the
185 /// column can be used in a WHERE clause with any comparison operator. Columns of type
186 /// `SQL_LONGVARCHAR` and `SQL_LONGVARBINARY` usually return `SQL_PRED_CHAR`.
187 Searchable = 13,
188 /// `SQL_DESC_TYPE_NAME`. Returned in `CharacterAttributePtr`. Data source-dependent data type
189 /// name; for example, "CHAR", "VARCHAR", "MONEY", "LONG VARBINARY", or "CHAR ( ) FOR BIT DATA".
190 /// If the type is unknown, an empty string is returned.
191 TypeName = 14,
192 /// `SQL_DESC_TABLE_NAME`. Returned in `CharacterAttributePtr`. The name of the table that
193 /// contains the column. The returned value is implementation-defined if the column is an
194 /// expression or if the column is part of a view. If the table name can not be determined an
195 /// empty string is returned.
196 TableName = 15,
197 /// `SQL_DESC_UNSIGNED`. Returned in `NumericAttributePtr`. `true` if the column is unsigned (or
198 /// not numeric). `false` if the column is signed.
199 Unsigned = 8,
200 /// `SQL_DESC_UPDATABLE`. Returned in `NumericAttributePtr`. Column is described by the values
201 /// for the defined constants: `SQL_ATTR_READONLY`, `SQL_ATTR_WRITE`,
202 /// `SQL_ATTR_READWRITE_UNKNOWN`.
203 /// `Updatable` Describes the updatability of the column in the result set, not the column in
204 /// the base table. The updatability of the base column on which the result set column is based
205 /// may be different from the value in this field. Whether a column is updatable can be based on
206 /// the data type, user privileges, and the definition of the result set itself. If it is
207 /// unclear whether a column is updatable, `SQL_ATTR_READWRITE_UNKNOWN` should be returned.
208 Updatable = 10,
209 #[cfg(feature = "odbc_version_4")]
210 /// `SQL_DESC_MIME_TYPE`.
211 MimeType = 36,
212}