If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#54508 by UnionSystems
Wed Aug 12, 2020 11:58 pm
Has anyone been able to use EXEC_SQL as described on page 397 of AwareIM 8.4 User Guide?

This action executes the specified SQL string by invoking the database engine, for
EXEC_SQL `UPDATE CRM_Customer SET Name='John'`

When we use it (with table and column names changed to match our database). We get an
Code: Select all Internal Error

The command is making it to mySQL because if we use incorrect table or column names we get an explicit message complaining about those bad names. We can also execute the submitted command at mySQL command line and it works OK there.
#54509 by UnionSystems
Thu Aug 13, 2020 3:50 am
I've found a remedy to this error.

If you add
Code: Select allRETURN BO
to the end of the action there is no "Internal Error" and the SQL is successfully executed. So
Code: Select allEXEC_SQL `UPDATE CRM_Customer SET Name='John'` RETURN AnyBO
works ok. (replacing CRM_Customer, Name and AnyBO with a real Business Object)

Seems AwareIM just wants to see this
Code: Select allRETURN AnyBo
at the end of the command even though it does not return anything related to "AnyBo".

This EXEC_SQL is powerful but as Vlad warns
to be careful when using this acton as you can stuff up your database

Who is online

Users browsing this forum: No registered users and 39 guests