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 rows but does not delete the table itself.

This example shows how a DELETE statement is passed to Oracle to empty the EMP table.

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

Oracle then executes this code:

delete from emp

Previous Page | Next Page | Top of Page