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.
-
When you supply the
connection information to PROC DBLOAD, the
SAS/ACCESS interface calls
the DBMS to connect to the database.
-
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.
-
SAS uses the information
that is provided by the DBLOAD procedure to construct an SQL CREATE
TABLE statement and passes it to the DBMS.
-
SAS constructs an SQL
INSERT statement for the current observation and passes it to the
DBMS. New INSERT statements are constructed and 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.
-
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.
-
SAS closes the connection
with the DBMS.