ExecuteSQL(MySQLStatement as Text255)
BEGIN
IF NOT GET THEN INSERT;
"SQL Statement" := MySQLStatement;
MODIFY;
END;
Then go to the SQL EM and open the table there, open triggers and add trigger onUpdate. write a sql code that takes new value of "SQL Statement" and runs exec on this (like exec @mystr)
Example:
To run SQL proceudre on button:
define global or local:
rNavi2SQL record Navi2SQL
OnPush:
rNavi2SQL.ExecuteSQL('spMySQLProcedure');
this way you can run lots of different SQL statements from Navison... you are limited only by error handling and returning values, but you can extand the table with some error fields that you will handel in SQL trigger...
usfull for UPDATE and DELETE (runs faster), but you should know very very well what are you doing !!!
Comments
Make a table "Navi2SQL" with two fields: and set DataPerCompany=No
Add a function: Then go to the SQL EM and open the table there, open triggers and add trigger onUpdate. write a sql code that takes new value of "SQL Statement" and runs exec on this (like exec @mystr)
Example:
To run SQL proceudre on button:
define global or local:
rNavi2SQL record Navi2SQL
OnPush:
rNavi2SQL.ExecuteSQL('spMySQLProcedure');
this way you can run lots of different SQL statements from Navison... you are limited only by error handling and returning values, but you can extand the table with some error fields that you will handel in SQL trigger...
usfull for UPDATE and DELETE (runs faster), but you should know very very well what are you doing !!!
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯