OC GET SPECIAL COLUMN LIST

4D - Documentation   Français   English   German   4D ODBC, Command Theme List   4D ODBC, Command Alphabetical List   Back   Previous   Next

version 6.5


OC GET SPECIAL COLUMN LIST (cursor_ID; mode; tableTarget; aScope; columnName; dataType; typeName; precision; length; scale; pseudoColumn)

ParameterTypeDescription
cursor_IDLongintConnection Identifier
modeInteger1 or 2
tableTargetStringName of the target table
aScopeStringName of 4D array
columnNameStringName of 4D array
dataTypeStringName of 4D array
typeNameStringName of 4D array
precisionStringName of 4D array
lengthStringName of 4D array
scaleStringName of 4D array
pseudoColumnStringName of 4D array

Description

The OC GET SPECIAL COLUMN LIST command allows you to get the optimal set of columns that uniquely identifies a row in a specific table. It also returns the columns that are automatically updated when any value in the row is updated by a transaction.

cursor_ID must be a valid cursor.

mode allows you to set the mode:

1 -> SQL_BEST_ROWID, to return the columns that are uniquely identified.
2 -> SQL_ROWER, to return the columns that are automatically updated by the data source
when any value in the row is updated by any transaction.

tableTarget is the name of the target table of the data source.

aScope is the actual scope of the ROWID. It can contain one of the following values:

0 -> SQL_SCOPE_CURROW
The ROWID is guaranteed to be valid only while positioned on that row. A subsequent reselect
using ROWID may not return a row if the row was updated or deleted by another
transaction.
1 -> SQL_SCOPE_TRANSACTION
The ROWID is guaranteed to be valid for the duration of the current transaction.
2 -> SQL_SCOPE_SESSION
The ROWID is guaranteed to be valid for the duration of the session (across transaction
boundaries).

columnName is the name of the target table of the data source.

dataType is the SQL data type. This can be an ODBC SQL data type or a driver-specific SQL data type.

typeName is the name of the type depending on the data source.

precision is the precision of the column on the data source.

length is the length in bytes of data transferred on an SQLGETDATA or SQLFETCH operation. For numeric data, the size may be different from the size of the data stored in the data source. This value is the same as the precision parameter for character or binary data.

scale is the scale of the column on the data source. An empty string is returned for data where scale is not applicable.

pseudoColumn indicates whether the column is a pseudo-column like Oracle ROWID.

Example

   ARRAY STRING(15;aScope;0)
   ARRAY STRING(15;aColumnName;0)
   ARRAY STRING(15;aDataType;0)
   ARRAY STRING(15;aTypeName;0)
   ARRAY STRING(15;aPrecision;0)
   ARRAY STRING(15;aLength;0)
   ARRAY STRING(15;aScale;0)
   ARRAY STRING(15;aPseudoColumn;0)

   loginID:=OC Login ("sa";"";"MSSQL65")
   cursor:=OC Create cursor (loginID)
   OC GET SPECIAL COLUMN LIST(cursor;1;"employee";"aScope";"aColumnName";"aDataType";
                              "aTypeName";"aPrecision";"aLength";"aScale";"aPseudoColumn")
   OC DROP CURSOR (cursor)
   OC LOGOUT (loginID)

See Also

OC GET COLUMN LIST.


4D - Documentation   Français   English   German   4D ODBC, Command Theme List   4D ODBC, Command Alphabetical List   Back   Previous   Next