SAS Institute. The Power to Know

SAS/ACCESS(R) 9.2 for Relational Databases: Reference

space
Previous Page | Next Page

Optimizing Your SQL Usage

Passing the DELETE Statement to Empty a Table

When you use the SAS/ACCESS LIBNAME statement with the DIRECT_EXE option set to DELETE, the SAS SQL DELETE statement gets passed to the DBMS for execution as long as it contains no WHERE clause. The DBMS deletes all the rows, but does not delete the table itself.

The following example illustrates how a DELETE statement gets passed to Oracle for the table EMP to be emptied:

libname myoralib oracle user=testuser password=testpass direct_exe=delete;
proc sql;
   delete from myoralib.emp;
quit;

This code causes Oracle to execute the following:

delete from emp

space
Previous Page | Next Page | Top of Page