Event Reference > Quick Reference for All Events > FormatLiteral Event |
C1Query_FormatLiteral (Field As Field, Value, Text As String)
Arguments
Field is the Field object describing the field to which the constant value belongs. The field’s data type can be obtained from Field.Type.
Value is the constant value generating a literal in the SQL statement.
Text is the literal text. This argument can be set to a desired value if you want to specify the literal text programmatically.
Description
FormatLiteral event occurs before a literal value is inserted into SQL statement during SQL generation executing BuildSQL. It provides an opportunity to change the literal text, format it according to your database requirements or other considerations.
After this event, the literal text is enclosed in quotation marks if it is required by its data type. Quotation is performed for date/time and string data types. If you need to suppress the quotation, set StringLiteralQuote and/or DateTimeQuote properties of C1Query.SQLInfo to c1qQuoteNone (=0).
See Also
Database-Dependent Aspects of SQL Generation