Chapter Contents |
Previous |
Next |
SAS/ACCESS Software for Relational Databases: Reference |
DBLOAD Procedure Statements for CA-OpenIngres |
The syntax for other statements that you use to create and load a CA-OpenIngres table is provided below.
Note: The SAS/ACCESS interface
to CA-OpenIngres DBLOAD procedure does not use the following procedure statements:
USER= and PASSWORD=.
The SAS/ACCESS interface to CA-OpenIngres DBLOAD procedure uses the following statements in interactive line, noninteractive, or batch mode:
PROC DBLOAD <DBMS=INGRES>
<DATA=<libref.> SAS-data-set>
<APPEND>;
|
RUN; |
The APPEND option assumes that the table that is specified in the TABLE= statement exists. To create a CA-OpenIngres table to append to, first use PROC DBLOAD with the SQL statement. Then specify another PROC DBLOAD step with APPEND. If the table does not exist, the procedure fails and an error message is displayed.
Other PROC DBLOAD statements such as DELETE and RENAME work differently when they are used with the APPEND option.
Suppose that you have a data set named INVDATA that you want to append to an existing CA-OpenIngres table. The following example shows how to use the APPEND option to append rows from the INVDATA data set to the table named INVOICE.
proc dbload dbms=ingres data=invdata append; database='testnode::testdatabase/star'; table=invoice; load; run;
If you use a remote database, you enter the remote virtual node name. If you use a distributed database, you enter the database server type. If you use a remote distributed database, you enter the database node name and server type.
INGRES
for a CA-OpenIngres DBMS server or
STAR
for a CA-OpenIngres/Star
server. (You can replace
/STAR
with its alias,
/D
.)
If you omit a server type, the default server type, INGRES, for the CA-OpenIngres
DBMS is used.The following example creates a new CA-OpenIngres table, INVOICE, from the DLIB.INVOICE data file. An access descriptor ADLIB.INVOICE is also created, based on the new table. The AMTBILLED column and the 5th column in the table (AMOUNTINUS) are renamed. You must be granted the appropriate privileges in order to create new CA-OpenIngres tables or views.
libname adlib 'SAS-data-library'; libname dlib 'SAS-data-library'; proc dbload dbms=ingres data=dlib.invoice; database='textiledb'; table=invoice; accdesc=adlib.invoice; rename amtbilled = amountbilled 5 = amountindollars; nulls invnum=n amtbill=n; load; run;
The next example only sends an SQL GRANT statement to the TEXTILEDB database and does not create a new table. Therefore, the TABLE= and LOAD statements are omitted.
proc dbload dbms=ingres; database='textiledb'; sql grant select on customers to frederick; run;
Use the DELETE statement to drop a SAS input variable that has no corresponding CA-OpenIngres column. Use the RENAME statement if the names do not match. If there is not a CA-OpenIngres column for each SAS variable, the APPEND operation is rejected.
The RENAME statement indicates the column name in the CA-OpenIngres table for the SAS data set variable that you specify. This example loads the data that is associated with the SAS variable COUNTRY into the CA-OpenIngres column named ORIGIN.
rename country=origin;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.