TO_SQL_LITERAL

Help Contents

Introduction

Translates an IEC 61131-3 elementary type into an SQL Literal.

Informal Syntax:

TO_SQL_LITERAL( In )

Formal Syntax:

TO_SQL_LITERAL( In:=expression )

Parameters

ParameterTypeDescription
InANY_ELEMENTARYThe input value to convert to an SQL Literal.

Return Value

The function TO_SQL_LITERAL returns a STRING value containing the SQL Literal.

Examples

ExampleReturn 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.

Standards Compliance

The function TO_SQL_LITERAL is an extension to the IEC 61131-3 standard.

Further Information

Conversion Functions

To learn about other Conversion Functions.

String Literals

To learn about string literals and the different types of encoding used.

SQL Interval Literals

To learn how interval values are represented in SQL.

SQL Date and Time Literals

To learn how date and time values are represented in SQL.

Common Elements

To learn about other IEC 61131-3 Common Elements.

Glossary

For the meaning of terms used in Fernhill SCADA.