Chapter Contents |
Previous |
Next |
SAS/ACCESS Software for Relational Databases: Reference |
You can use the pass-through facility of PROC SQL to build your own Teradata SQL statements and then pass them to the Teradata server for execution. The PROC SQL CONNECT statement defines the connection between SAS and the Teradata DBMS. See Chapter 6, "SQL Procedure's Interaction with SAS/ACCESS Software" .
The following section describes the DBMS-specific arguments that you use in the CONNECT statement to establish a connection with a Teradata database.
Arguments to Connect to Teradata |
The SAS/ACCESS Interface to Teradata can connect to multiple Teradata servers and to multiple Teradata databases. However, if you use multiple, simultaneous connections, you must use an alias argument to identify each connection.
USER
and
PASSWORD
are the only
required options.
CONNECT TO TERADATA <AS alias>
(USER=TERADATA-user-name
PASSWORD=TERADATA-password <TDPID=dbcname SCHEMA=alternate-database ACCOUNT=account_ID>); |
Pass-Through Examples |
This section presents simple pass-through examples. If you need background
information to understand any example, or need more sophisticated examples,
see the PROC SQL documentation available from SAS Institute.
proc sql; connect to teradata as dbcon (user=kamdar pass=ellis); quit;
In Example 1, SAS/ACCESS
dbcon
.
proc sql; connect to teradata as tera ( user=kamdar password=ellis ); execute (drop table salary) by tera; execute (create table salary (current_salary float, name char(10))) by tera; execute (insert into salary values (35335.00, 'Dan J.')) by tera; execute (insert into salary values (40300.00, 'Irma L.')) by tera; disconnect from tera; quit;
In Example 2, SAS/ACCESS
tera
.
proc sql; connect to teradata as tera ( user=kamdar password=ellis ); execute (update salary set current_salary=45000 where (name='Irma L.')) by tera; disconnect from tera; quit;
In Example 3, SAS/ACCESS
tera
.
proc sql; connect to teradata as tera2 ( user=kamdar password=ellis ); select * from connection to tera2 (select * from salary); disconnect from tera2; quit;
In Example 4, SAS/ACCESS
tera2
.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.