Previous Page | Next Page

SAS/ACCESS Interface to Oracle

DBLOAD Procedure Specifics for Oracle

For general information about this feature, see The DBLOAD Procedure for Relational Databases. Oracle examples are available.

The Oracle interface supports all DBLOAD procedure statements. See About DBLOAD Procedure Statements.

Here are the DBLOAD procedure specifics for Oracle.


Examples

The following example creates a new Oracle table, EXCHANGE, from the DLIB.RATEOFEX data file. (The DLIB.RATEOFEX data set is included in the sample data shipped with your software.) An access descriptor, ADLIB.EXCHANGE, based on the new table, is also created. The PATH= statement uses an alias to connect to a remote Oracle 7 Server database.

The SQL statement in the second DBLOAD procedure sends an SQL GRANT statement to Oracle. You must be granted Oracle privileges to create new Oracle tables or to grant privileges to other users. The SQL statement is in a separate procedure because you cannot create a DBMS table and reference it within the same DBLOAD step. The new table is not created until the RUN statement is processed at the end of the first DBLOAD step.

libname adlib 'SAS-data-library';
libname dlib 'SAS-data-library';

proc dbload dbms=oracle data=dlib.rateofex;
   user=testuser; 
   orapw=testpass;
   path='myorapath';
   table=exchange;
   accdesc=adlib.exchange;
   rename fgnindol=fgnindolar 4=dolrsinfgn;
   nulls updated=n fgnindol=n 4=n country=n;
   load;
run;

proc dbload dbms=oracle;
   user=testuser; 
   orapw=testpass;
   path='myorapath';
   sql grant select on testuser.exchange to pham;
run;

This next example uses the APPEND option to append rows from the INVDATA data set, which was created previously, to an existing Oracle table named INVOICE.

proc dbload dbms=oracle data=invdata append;    
  user=testuser; 
  orapw=testpass;    
  path='myorapath';    
  table=invoice; 
  load; 
run;

Previous Page | Next Page | Top of Page