EXEC_SQL

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
UnionSystems
Posts: 197
Joined: Fri Jun 17, 2016 7:10 am
Location: Brisbane Australia
Contact:

EXEC_SQL

Post by UnionSystems »

Has anyone been able to use EXEC_SQL as described on page 397 of AwareIM 8.4 User Guide?
EXEC_SQL Action
This action executes the specified SQL string by invoking the database engine, for
example:
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.
AWS Linux, Windows Server, AIM 8.4 & 8.6
UnionSystems
Posts: 197
Joined: Fri Jun 17, 2016 7:10 am
Location: Brisbane Australia
Contact:

Re: EXEC_SQL

Post by UnionSystems »

I've found a remedy to this error.

If you add

Code: Select all

RETURN BO
to the end of the action there is no "Internal Error" and the SQL is successfully executed. So

Code: Select all

EXEC_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 all

RETURN 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
AWS Linux, Windows Server, AIM 8.4 & 8.6
Post Reply