- Procedure DirectSQL(Datasource, SQLstatement)
With the procedure
DirectSQL you can directly execute SQL statements
within a data source.
DirectSQL( Datasource, ! (input) a string expression SQLstatement ! (input) a string expression )
A string containing the name of a data source.
A string containing the SQL statement that must be executed within the data source.
The procedure returns 1 if the SQL statement is executed successfully, or 0 if the execution failed. In case of failure, the corresponding error message can be obtained through the predefined string parameter
If the SQL statement also produces a result set, then this set is ignored by AIMMS.
Note that the SQL dialect used by, for instance, Oracle, SQL Server and Microsoft Access may differ. If a call to
DirectSQLfails because of such differences, you should inspect
CurrentErrorMessagefor further details.
Calling stored procedures and executing SQL queries through AIMMS
DATABASE PROCEDURES is discussed in Executing Stored Procedures and SQL Queries of the Language