SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Accessing Other Vendors' DBMS Data
DBMS Access Using the SQL Procedure Pass-Through Facility


EXECUTE Statement

You may want to send dynamic, non-query, DBMS-specific SQL statements to the DBMS for processing. To do so, use the EXECUTE statement.


General form, EXECUTE statement:
EXECUTE( DBMS-specific-SQL-statement)
                   BY dbms-name | alias;

where

  • DBMS-specific-SQL-statement is a dynamic, non-query SQL statement enclosed in parentheses. The statement may be case-sensitive and is passed to the DBMS exactly as you type it.

  • dbms-name | alias identifies the DBMS or its alias. You cannot use an alias if you omitted the CONNECT statement.


Typically, the DBMS-specific SQL statements in an EXECUTE statement include one or more of the following:
  • CREATE a DBMS table, view, index, or other object
  • INSERT rows to a DBMS table
  • DELETE rows from a DBMS table
  • UPDATE the data in a DBMS table
  • DROP or delete a DBMS table, view, or other object
  • GRANT authority to access or modify objects
  • REVOKE the access or modification privileges that were given by the GRANT statement.


Example

In the following program, the EXECUTE statement grants UPDATE and INSERT authority to user CESTMOI for the DBMS table Orders.

     proc sql;
        connect to oracle as dblink
                (user=cestmoi pw=trustme 
                 path=oracpath connection=global);
        execute (grant update, insert on orders
                 to cestmoi) by dblink;
        disconnect from dblink;
     quit;

back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement