Chapter Contents |
Previous |
Next |
EXECUTE Statement |
Contains DBMS-specific arguments | |
Optional statement |
Syntax | |
Arguments | |
Useful Statements to Include in EXECUTE Statements |
Syntax |
EXECUTE (DBMS-specific-SQL-statement) BY dbms-name | alias; |
In some SAS/ACCESS interfaces, you can issue an EXECUTE statement directly without first explicitly connecting to a DBMS (see CONNECT Statement). If you omit the CONNECT statement, an implicit connection is performed (by using default values for all database connection arguments) when the first EXECUTE statement is passed to the DBMS. See your DBMS chapter for details.
The EXECUTE statement cannot be stored as part of an SQL Procedure Pass-Through Facility query in a PROC SQL view.
Arguments |
Any return code or message that is generated by the DBMS is available in the macro variables SQLXRC and SQLXMSG after the statement executes. See SQL Procedure Pass-Through Facility Return Codes for more information on these macro variables.
This section lists some of the statements that you can pass to the DBMS by using the SQL Procedure Pass-Through Facility's EXECUTE statement.
For more information and restrictions on these and other SQL statements, see your DBMS-specific SQL documentation.
The following example grants UPDATE and INSERT authority to user TESTUSER on the Oracle Rdb table ORDERS. Because the CONNECT statement is omitted, an implicit connection, that uses the default database, is made to Oracle Rdb.
proc sql; execute (grant update, insert on orders to [qa,testuser]) by rdb; %put &sqlxmsg;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.