f2s_column_default_sql_value_legacy¶

Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers

Syntax

set_attribute f2s_column_default_sql_value_legacy of {FileNumber} {FieldNumber} to {variable}
get_attribute f2s_column_default_sql_value_legacy of {FileNumber} {FieldNumber} to {variable}

Parameter

Description

FileNumber

Number of the file (filename.File_Number)

FieldNumber

Number of the field (field field name)

variable

String variable. The default value for the field.

Description

This attribute has been deprecated. Please use f2s_column_default_sql_value instead.

This attribute is used to get or set the default value for a given column. Getting the default value can be done anywhere in the code, however, setting the value can only be done within a Structure_Start/Structure_End block.

Only constants can be used when setting this attribute (unlike f2s_column_default_sql_value). The driver will automatically add quotes around the passed variable. If the variable is malformed, the default value for the column will be deleted but NOT recreated. No error is generated.

When creating a table, if the attribute is not set, it is defaulted to the driver default. For more information, please see Mertech.cfg.

Examples

get_attribute

Handle hCustomer
Integer iState
String sDefault

Move Customer.File_Number to hCustomer
Field_Map hCustomer "State" to iState

Get_Attribute f2s_column_default_sql_value_legacy of hCustomer iState to sDefault

set_attribute

Handle hCustomer
Integer iState
String sDefault

Move Customer.File_Number to hCustomer
Field_Map hCustomer "State" to iState

Get_Attribute f2s_column_default_sql_value_legacy of hCustomer iState to sDefault

Showln (SFormat("The Default value for State is %1", sDefault))

Structure_Start hCustomer _f2s_ActiveDriver
Set_Attribute f2s_column_default_sql_value_legacy of hCustomer iState to "MN"
Structure_End hCustomer DF_STRUCTEND_OPT_NONE "." 0

Open Customer
Move Customer.File_Number to hCustomer
Field_Map hCustomer "State" to iState

Get_Attribute f2s_column_default_sql_value_legacy of hCustomer iState to sDefault
Showln (SFormat("The Default value for State is %1", sDefault))

Related Attributes

Replaces: DF_FIELD_DEFAULT_VALUE