Chapter Contents |
Previous |
Next |
SAS/ACCESS Software for Relational Databases: Reference |
The statements for your DBMS may differ from those listed here. See your DBMS chapter for details.
PROC DBLOAD <statement-options>; |
Database Connection Statements | |||||||||||||||
These statements are used to connect to your DBMS and vary depending on which SAS/ACCESS interface you are using. See your DBMS chapter for details. Examples include USER=, PASSWORD=, and DATABASE=. | |||||||||||||||
Table Statement
| |||||||||||||||
Editing
Statements
| |||||||||||||||
Creating and
Loading
Statement
|
Details |
The DBLOAD procedure associates each SAS variable with a DBMS column and assigns a default name and data type to each column. It also specifies whether each column accepts null values. You can use the default information or change it as necessary. When you are finished customizing the columns, the procedure creates the DBMS table and loads or appends the input data.
PROC DBLOAD Statement Options |
The
following options can be used in the PROC DBLOAD statement.
Note: When you use APPEND, you
must ensure that your input data corresponds exactly to the columns in the
DBMS table. If your input data does not include values for all columns in
the DBMS table, you might corrupt your DBMS table by inserting data into the
wrong columns. You can use the COMMIT, ERRLIMIT, and LIMIT statements to help
safeguard against data corruption. The ERRLIMIT statement defaults to 10 when
used with APPEND.
The DELETE and RENAME statements can be used with APPEND to drop and rename SAS input variables that do not have corresponding DBMS columns. The RENAME statement indicates the column name in the DBMS table for the SAS data set variable that you specify. For example, this statement loads data that is associated with the SAS variable COUNTRY into the DBMS column named ORIGIN:
rename country=origin;All PROC DBLOAD statements and options can be used with APPEND, except for the NULLS and TYPE statements, which have no effect when used with APPEND. The LOAD statement is required.
The following example appends new employee data from the SAS data set NEWEMP to the DBMS table EMPLOYEES. The COMMIT statement causes a DBMS commit to be issued after every 100 rows are inserted. The ERRLIMIT statement causes processing to stop after 10 errors occur.
proc dbload dbms=oracle data=newemp append; user=testuser; password=testpass; path='myorapath'; table=employees; commit=100; errlimit=5; load; run;
Note: By omitting the APPEND option from
the DBLOAD statement, you can use the PROC DBLOAD SQL statements to create
a DBMS table and append to it in the same PROC DBLOAD step.
Procedure Statements |
To invoke PROC DBLOAD, you use the options listed in Options along with certain statements. The statements that you choose are determined by your task and your database. These statements vary per DBMS and might be optional; see your DBMS chapter for more information.
Options and Statements Required for the DBLOAD Procedure summarizes the PROC DBLOAD options and statements.
Tasks | Options and Statements You Use | |||||||
---|---|---|---|---|---|---|---|---|
create and load a DBMS table |
|
|||||||
submit a dynamic, non-query DBMS-SQL statement to DBMS (without creating a table) |
|
The PROC DBLOAD statements are described in alphabetic order in the following sections.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.