User`s guide
exec
7-113
exec
Execute SQL statement and open cursor
Syntax
curs = exec(conn,sqlquery)
curs = exec(conn,sqlquery,qTimeOut)
curs = exec(conn,sqlquery,Name,Value)
Description
curs = exec(conn,sqlquery) executes the SQL statement sqlquery for the database
connection conn and returns the cursor object curs.
curs = exec(conn,sqlquery,qTimeOut) executes the SQL statement with a
timeout value qTimeOut.
curs = exec(conn,sqlquery,Name,Value) executes the SQL statement and creates
a scrollable cursor.
Examples
Select Data from a Database Table Using the Native ODBC Interface
Create a connection conn using the native ODBC interface and the dbtoolboxdemo
data source.
conn = database.ODBCConnection('dbtoolboxdemo','admin','admin');
Select data from productTable that you access using the database.ODBCConnection
object, conn. Assign the SQL statement to the variable sqlquery. Assign the returned
cursor object to the variable curs.
sqlquery = 'select * from productTable';
curs = exec(conn,sqlquery)
curs =
ODBCCursor with properties: