DB.TField.DefaultExpression

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From DB.pas

	property DefaultExpression: string read FDefaultExpression write FDefaultExpression;


Unit: DB

Type: property

Visibility: published

Member Of: TField

C++ Information

From DB.hpp

	__property System::UnicodeString DefaultExpression = {read=FDefaultExpression,write=FDefaultExpression};


Unit: DB

Type: property

Visibility: public

Member Of: TField

Description

Specifies an SQL expression that is assigned to the field if the user does not provide a value.


Set DefaultExpression to provide a default value for a field. DefaultExpression can be any valid SQL value expression that does not refer to field values. If the expression contains literals other than numeric values, they must appear in quotes. For example, a default value of noon for a time field is

'12:00:00'

including the quotes around the literal value.

Note:  If you supply a value for DefaultExpression, this value takes precedence over any default values for the field implemented on the database server. This is because DefaultExpression is applied to the field in your application before any edits are sent to the server.

See Also

Personal tools
Translations
Newest Version