DBExec


 

Not supported in Macro Scheduler Lite.

 

DBExec>database_reference,SQL_Statement,result

 

Executes an SQL statement.  Use DBExec to execute SQL statements that do not return a recordset.  E.g. DELETE, INSERT and UPDATE queries.

 

For SELECT queries use DBQuery to return a recordset array.

 

Accepts a database reference created by a call to DBConnect, and an SQL_Statement.  Specify a result variable to return the number of rows affected by the SQL statement.

 

To set a timeout for the command set the DB_COMMANDTIMEOUT variable to a number of seconds.

 

For more advanced database manipulation use VBScript.  See:

http://www.mjtnet.com/blog/2006/02/20/accessing-databases/

 

Abbreviation: DBE

See also: DBConnect, DBClose, DBQuery

 

Example

 

Let>str=Driver={MySQL ODBC 3.51 Driver};Server=someserver.com;Port=3306;Database=example;User=admin;Password=xxxx;Option=3;
 DBConnect>str,dbH
  
 Let>SQL=delete from mytable where ID=1234
 DBExec>dbH,SQL,result
  
 DBClose>dbH