runRealSQLQuery()

The function runRealSQLQuery executes an SQL query of the RDB database.

Synopsis

int runRealSQLQuery(string sqlQuery, dyn_dyn_anytype result);

Parameters

Parameter Description
sqlQuery An SQL query. Note that an SQL query must be used. This is not a WinCC OA SQL query. Use the SQL syntax (the commands SELECT, FROM, WHERE etc.). See example further below.
result The result of the query.

Return value

In the event of an error, the function returns 0 otherwise, 1.

Error

Invalid or missing arguments

Description

The function runRealSQLQuery executes an SQL query of the RDB database. The query is executed by using the current database connection.

Be cautious when using the function. Invalid queries might cause undesired side effects.

Example

The example selects the original values from the table EVENTHISTORY_31615001 and outputs them.

main()
{


   dyn_dyn_anytype result;


   int i;
   i =  runRealSQLQuery("SELECT '_original.._value' FROM EVENTHISTORY_31615001", result);


   DebugN(result);


}

Availability

UI