Use this format to execute a SQL statement that does not produce a result set and does not require input parameters. You can use this format to execute all forms of Data Definition Language (DDL).
EXECUTE IMMEDIATE SQLStatement {USING TransactionObject} ;
Parameter |
Description |
---|---|
SQLStatement |
A string containing a valid SQL statement. The string can be a string constant or a PowerBuilder variable preceded by a colon (such as :mysql). The string must be contained on one line and cannot contain expressions. |
TransactionObject (optional) |
The name of the transaction object that identifies the database. |
These statements create a database table named Employee. The statements use the string Mysql to store the CREATE statement.
string Mysql
Mysql = "CREATE TABLE Employee "&
+"(emp_id integer not null,"&
+"dept_id integer not null, "&
+"emp_fname char(10) not null, "&
+"emp_lname char(20) not null)"
EXECUTE IMMEDIATE :Mysql ;
These statements assume a transaction object named My_trans exists and is connected:
string Mysql
Mysql="INSERT INTO dept Values (1234, 'Purchasing')"
EXECUTE IMMEDIATE :Mysql USING My_trans ;
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |