PROC SQL은 검사 할 수있는 자동 매크로 변수를 유지합니다. 사용자 계정 정보를 소스 코드 또는 일반 텍스트 파일에 저장하면 보안 정책에주의해야합니다.
예 :
%macro myConnect();
%* To be used in the context of a Proc SQL statement;
%* ... assign first account connection parameters to macro variables;
%let terauser=...;
...
%let tdserver = ...;
connect to teradata (user="&terauser" password="&terapwd" account="&teraacct" server="&tdserver" mode=teradata);
%if &SQLXRC eq 0 %then %return;
%* ... assign second account connection parameters to macro variables;
%let terauser=...;
...
%let tdserver = ...;
connect to teradata (user="&terauser" password="&terapwd" account="&teraacct" server="&tdserver" mode=teradata);
%if &SQLXRC eq 0 %then %return;
%put ERROR: Could not connect with current connection parameters;
%abort cancel;
%mend;
Proc SQL
또한 기존 원격 라이브러리 참조를 사용하여 연결할 수 있습니다 : 당신이 암호가
DBC.USERSV
를 조회하여 마지막으로 변경 한 때 테라 데이타를 요청할 수 있습니다 연결받을 경우
* create remote library references;
libname account1 Teradata ... connection parameters ...;
libname account2 Teradata ... connection parameters ...;
Proc SQL;
connect using account1; * connect using the account1
usersV 테이블에 액세스 할 수없는 것 같습니다. 이 정보는 다른 곳에 있습니까? 친절하게 도와주세요. –
대신 'DBC.USERS' 뷰를 사용해보십시오. – Tom