SQLexecute


Purpose
Execute an SQL command.
Synopsis
procedure SQLexecute(s:string)
procedure SQLexecute(s:string, a:array)
procedure SQLexecute(s:string, m:set)
Arguments
SQL command to be executed
An array of one of the basic types (integer, real, string or Boolean). May be a tuple of arrays
A set of one of the basic types (integer, real, string or Boolean)
Example
The following example contains four SQLexecute statements performing the following tasks:
declarations
 prices: array(1001..1004) of real
 colors: array(1001..1004) of string
 allcolors: set of string
end-declarations

SQLexecute("select color from pricelist", allcolors)
SQLexecute("select articlenum,color,price from pricelist",
                                                  [colors,prices])
SQLexecute("create table newtab (ndx integer, price double)")	         
SQLexecute("insert into newtab (ndx, price) values (?,?)", prices) 
Further information
This procedure executes the given SQL command. The user is referred to the documentation of the database driver he is using for more information about the commands that are supported by it. Note that if extended syntax is in use (default), parameters usually noted '?' in normal SQL queries may be numbered (like '?1','?2',...) in order to control in which order are mapped columns of data source table to Mosel arrays. This feature is especially useful when writing 'update' queries for which indices must appear after values (e.g. "update mytable set datacol=?2 where ndxcol=?1").
Related topics
SQLupdate, SQLreadinteger, SQLreadreal, SQLreadstring.


If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.