The SQL Procedure |
Requirement: | SAS/ACCESS software is required. For more information on this statement, see your SAS/ACCESS documentation. | ||
See also: |
|
EXECUTE (dbms-SQL-statement)
BY dbms-name|alias; |
Arguments |
specifies an optional alias that is defined in the CONNECT statement. Note that alias must be preceded by the keyword BY.
identifies the DBMS to which you want to direct the DBMS statement (for example, ORACLE or DB2).
is any DBMS-specific SQL statement, except the SELECT statement, which can be executed by the DBMS-specific dynamic SQL. The SQL statement can contain a semicolon. The SQL statement can be case-sensitive, depending on your data source, and it is passed to the data source exactly as you type it.
Details |
If your DBMS supports multiple connections, then you can use the alias that is defined in the CONNECT statement. This alias directs the EXECUTE statements to a specific DBMS connection.
Any return code or message that is generated by the DBMS is available in the macro variables SQLXRC and SQLXMSG after the statement completes.
Example |
The following example, after the connection, uses the EXECUTE statement to drop a table, create a table, and insert a row of data.
proc sql; execute(drop table ' My Invoice ') by db; execute(create table ' My Invoice '( ' Invoice Number ' LONG not null, ' Billed To ' VARCHAR(20), ' Amount ' CURRENCY, ' BILLED ON ' DATETIME)) by db; execute(insert into ' My Invoice ' values( 12345, 'John Doe', 123.45, #11/22/2003#)) by db; quit;
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.