SQLSelect.FieldInfo Method | |
Retrieve information about or set an alias for the indicated column.
Namespace:
VO
Assembly:
VOSQLClasses (in VOSQLClasses.dll) Version: 2.19
Syntax VIRTUAL METHOD FieldInfo(
kFieldInfoType,
uFieldPos,
uFieldVal
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public virtual Usual FieldInfo(
Usual kFieldInfoType = default,
Usual uFieldPos = default,
Usual uFieldVal = default
)
Request Example
View SourceParameters
- kFieldInfoType (Optional)
- Type: Usual
The type of information, as specified by the following constants:
- uFieldPos (Optional)
- Type: Usual
The name, number, or symbol representing the desired column. - uFieldVal (Optional)
- Type: Usual
The alias name to be assigned to the column. This argument is only used if DB_ALIAS is specified for kColumnInfoType.
Return Value
Type:
Usual
A value (whose data type depends on the value requested) if successful; otherwise, NIL.
Remarks
The SQLSelect:FieldInfo() method is used to retrieve information about a column, except if you specify
kColumnInfoType to be DBS_ALIAS.
You can then specify an alias for a column, which you can access by using the SQLColumn:AliasName property.
Tip |
---|
The values in the table below exist both as DEFINEs and also as members of the DbFieldInfo enum.
You can see the numeric values of the defines in the documentation of this Enum.
|
Constants | Description |
---|
DBS_NAME | Returns the name of the field. |
DBS_TYPE | Returns the data type of the field. |
DBS_LEN | Returns the length of the field. |
DBS_DEC | Returns the number of decimal places for the field. |
DBS_ALIAS |
Returns and optionally changes an alternate name (or alias) by which a field can be referenced (by default, same as DBS_NAME).
|
DBS_PROPERTIES | Returns the number of properties defined for a field. |
DBS_BLOB_DIRECT_LEN |
Returns the length of data in a BLOB as an unsigned long integer, without referencing a particular memo field.
For strings, the return value is the length of the string in bytes; for arrays, it is the number of elements in the first dimension;
for all other data types, it returns -1. With this constant, you must specify the BLOB using a numeric pointer obtained from DBServer:BLOBDirectPut(),
DBServer:BLOBDirectImport(), or DBServer:FieldInfo(DBS_BLOB_POINTER, ... />).
|
DBS_BLOB_DIRECT_TYPE |
To determine the data type of BLOB data, without reference to a particular memo field, use DBServer:FieldInfo(DBS_BLOB_DIRECT_TYPE, ...).
With this constant, you must specify the BLOB using a numeric pointer obtained from DBServer:BLOBDirectPut(), DBServer:BLOBDirectImport(),
or DBServer:FieldInfo(DBS_BLOB_POINTER, ...).
See DBS_BLOB_TYPE for a table of possible return values.
|
DBS_BLOB_LEN |
Returns the length of the BLOB data in a memo field as an unsigned long integer. For strings, the return value is the length of the string in bytes;
for arrays, it is the number of elements in the first dimension; for all other data types, it returns -1.
Tip |
---|
DBServer:FieldInfo(DBS_BLOB_LEN, ...) has a performance advantage over the Len() function. |
|
DBS_BLOB_POINTER | Returns a numeric pointer to the BLOB data associated with a memo field. |
DBS_BLOB_TYPE |
Unlike memo fields maintained in .DBT files, BLOB files allow you to store many different types of data in memo fields.
However, the standard functions for determining data types, such as ValType(), simply treat BLOB fields as regular memo fields.
To determine the actual type of BLOB data stored in a memo field, use DBServer:FieldInfo(DBS_BLOB_TYPE, ...).
The data type of the return value is string and can be interpreted using this table:
Returns | Meaning |
---|
? | Blank (empty/uninitialized field) | A | Array | C | String | D | Date | E | Error | L | Logical | N | Numeric | U | Undefined (NIL was stored) |
|
DBS_USER | Start of user defined DBS_ values. |
Tip |
---|
DBS_USER is a constant that returns the minimum value that third-party RDD developers can
use for defining new properties. Values less than DBS_USER are reserved for X# development.
|
See Also