How do I generate a SQL query in the controller?
Creating the SQL command is different depending on the syntax of the controller. All controllers have in common that the string can be put together with the „Request-Arrays". Example:
g_saRequest[1] := "SELECT id, fParam2 FROM tTable1 WHERE "
g_saRequest[2] := "iParam1 ="
g_saRequest[3] := INT_TO_STRING(iMyPLCvariable)
The function block of the controller combines the array automatically and sends the following SQL command to the Connector/database:
"SELECT id, fParam2 FROM tTable1 WHERE param1=123"