Translates an IEC 61131-3 elementary type into an SQL Literal.
Informal Syntax:
TO_SQL_LITERAL( In )
Formal Syntax:
TO_SQL_LITERAL( In:=expression )
Parameter | Type | Description |
---|---|---|
In | ANY_ELEMENTARY | The input value to convert to an SQL Literal. |
The function TO_SQL_LITERAL returns a STRING value containing the SQL Literal.
Example | Return Value |
---|---|
TO_SQL_LITERAL( 1 ) | STRING#'1' |
TO_SQL_LITERAL( T#5s ) | STRING#'INTERVAL $'5$' SECOND' |
TO_SQL_LITERAL( TOD#12:00:00.00 ) | STRING#'TIME $'12:00:00.00$'' |
TO_SQL_LITERAL( WSTRING#"" ) | STRING#'$'$'' |
See SqlCommandFromTagDB Function Block for more examples of how to use the TO_SQL_LITERAL() function.
The function TO_SQL_LITERAL is an extension to the IEC 61131-3 standard.
To learn about other Conversion Functions.
To learn about string literals and the different types of encoding used.
To learn how interval values are represented in SQL.
To learn how date and time values are represented in SQL.
To learn about other IEC 61131-3 Common Elements.
For the meaning of terms used in Fernhill SCADA.