EXECUTE Statement

Submits SQL statements that do not return a result set directly to the server.

Valid in: SPD Server

Syntax

EXECUTE (SQL-statement) BY [engine-name | alias];

Required Arguments

(SQL-statement)

a valid SQL statement for the SPD Server SQL processor. This argument is required and must be enclosed within parentheses.

engine-name

specifies the SASSPDS engine. The engine value must be preceded by the keyword BY. You must specify either SASSPDS or the alias from your CONNECT statement.

alias

(optional) specifies an alias that can be used in the CONNECT statement. If you did not specify an alias in your CONNECT statement, then you must specify SASSPDS.

Details

Before you use the EXECUTE statement, you must establish a connection to the server by using the CONNECT statement. Use the EXECUTE statement to submit SAS SQL statements that do not return a result set to the SQL processor. You cannot submit a SELECT statement in the EXECUTE statement. Use the PROC SQL SELECT statement with the FROM CONNECTION statement to submit SELECT queries directly to the server’s SQL processor. For information about the SAS SQL statements, see SAS SQL Procedure User’s Guide.
SPD Server SQL functions a little bit differently than SAS SQL. See Understanding the SPD Server SQL Processor for information about SPD Server SQL requirements before using the EXECUTE statement.
You can also submit the SPD Server CREATE VIEW, COPY TABLE, LOAD TABLE, BEGIN| END ASYNCHRONOUS OPERATION, LIBREF, and RESET statements in the EXECUTE statement.
Last updated: February 8, 2017