Skip to main content
Skip table of contents

f$SQLPG_to_string


f$SQLPG_to_string

With this function, an SQL command is made from the content of a parameter group which can be used for creating a WHERE condition or also as an UPDATE command. All recorded parameters are included in the SQL command. When inserting a value, the data type is taken into account. Text is wrapped in apostrophes. The separator between individual components must also be given. If the result is to be used as a WHERE condition for an SQL command, the separator ’ AND ’ must be entered. You must note that the spaces cannot be forgotten. If the SQL command is to be used for update components, ’,’ is to be entered as the separator.

Syntax:

SQL = f$SQLPG_to_String (PGName, separator [,Sort] )

 

Argument

Type

Meaning

 

PGName

String

The name of the parameter group whose values are used as criteria.

 

Separator

String

The separator to be used between criteria.

 

Sort

Integer

This parameter is optional.

Sort = 1 means that the parameters in the parameter group are sorted alphabetically before the output text is created.

Result:

String

The SQL string generated

If an SQL string could not be generated because the parameter group was NOVAL or could not be found, the result is set to NOVAL.

Example: generating a WHERE condition

Address.Preferredname = 'ABB'

Address. FirmaID = 1

SQL = f$SQLPG_to_String('Address',' AND ')

Result:

SQL = 'Preferredname' = 'ABB' AND FirmaID = 1

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.