Previous Page | Next Page

How SAS/ACCESS Works

How the DBLOAD Procedure Works

When you use the DBLOAD procedure to create a DBMS table, the procedure issues dynamic SQL statements to create the table and insert data from a SAS data file, DATA step view, PROC SQL view, or view descriptor into the table.

The SAS/ACCESS interface view engine completes these steps:

  1. When you supply the connection information to PROC DBLOAD, the SAS/ACCESS interface calls the DBMS to connect to the database.

  2. SAS uses the information that is provided by the DBLOAD procedure to construct a SELECT * FROM table-name statement, and passes the information to the DBMS to determine whether the table already exists. PROC DBLOAD continues only if a table with that name does not exist, unless you use the DBLOAD APPEND option.

  3. SAS uses the information that is provided by the DBLOAD procedure to construct an SQL CREATE TABLE statement and passes it to the DBMS.

  4. SAS constructs an SQL INSERT statement for the current observation and passes it to the DBMS. New INSERT statements are constructed and then executed repeatedly until all observations from the input SAS data set are passed to the DBMS. Some DBMSs have a bulk-copy capability that allows a group of observations to be inserted at once. See your DBMS documentation to determine whether your DBMS has this capability.

  5. Additional non-query SQL statements that are specified in the DBLOAD procedure are executed as the user submitted them. The DBMS returns an error message if a statement does not execute successfully.

  6. SAS closes the connection with the DBMS.

Previous Page | Next Page | Top of Page