DF_FIELD_DEFAULT_VALUE¶

Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex

Use this attribute to get or set the default value for a given column. Setting the default value can only be done during a structure_start or during table creation. If this attribute is not set, it is defaulted to the driver default. See Mertech.cfg

Syntax

Set_Attribute DF_FIELD_DEFAULT_VALUE of {FileNumber} {FieldNumber} to {variable}
Get_Attribute DF_FIELD_DEFAULT_VALUE of {FileNumber} {FieldNumber} to {variable}

Parameter

Description

FileNumber

Number of the file (file handle). For Get_attribute you can use either the file handle or Filename.File_Number. For Set_Attribute use the file handle designated in Structure_Start.

FieldNumber

Number of the field

variable

Variable for the default value of the field

Example

open Customer
String sDefault
Handle hFile
Integer iColumn

Move "California" to sDefault
Move Customer.File_Number to hFile
Move 3 to iColumn

Structure_Start hFile "ORA_DRV"
   Set_Attribute DF_FIELD_DEFAULT_VALUE of hFile iColumn to sDefault
Structure_End hFile DF_STRUCTEND_OPT_NONE "." 0

Get_Attribute DF_FIELD_DEFAULT_VALUE of hFile iColumn to sDefault