 |
ALPHA-VISION® Database Operations: ExecSql
|
ExecSql
SUMMARY
ExecSql - Executes the defined SQL-Statement for the ODBC Data source.
SYNTAX
ExecSql(
<odbc_datasource, sql>);
ARGUMENTS
- odbc_datasource (type:string)
-
The ODBC-Data source. ODBC Data sources are set up in system control.
- sql (type:string)
-
The SQL-instruction to be executed.
DESCRIPTION
Stack
- Missing arguments are taken from the stack.(and removed from there).
- The result is pushed onto the stack.
Effect
Executes the defined SQL-Statement for the ODBC Data source.
If the result is a table it is pushed onto the stack.
EXAMPLES
//Stack before: empty
FormatString("SELECT PROD_ID, DESCR FROM PRODUCTS WHERE TYPE = %s",
OBJ.ActProdType.Value);
ExecSql("MyData");
//Stack afterwards (1 Element: Array with 2 Records having 2 Fields each):
//{
// {
// {"PROD_ID", "ABC1"},
// {"DESCR", "Product ABC, Version 1"}
// },
// {
// {"PROD_ID", "XYZ2"},
// {"DESCR", "Product XYZ, Version 2"}
// }
//}
Syntax Notation
- [aaa]
- aaa is optional (zero or one occurences)
- (aaa|bbb)
- aaa exclusive or bbb
- (aaa)*
- aaa may occur indefinitely often or may be omitted
- (aaa)+
- aaa may occur indefinitely often but at least once
- (aaa)m..n
- aaa may occur from m to n times