13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>SAS</strong>/<strong>ACCESS</strong> Interface to Teradata 4 Examples 835users update or insert into the table, they can lock you out from reading the table.In this situation, you want to reduce the isolation level during a read operation. Todo this, you specify these read <strong>SAS</strong>/<strong>ACCESS</strong> lock options and values.3 READ_ISOLATION_LEVEL=<strong>ACCESS</strong>3 READ_LOCK_TYPE=TABLE3 READ_MODE_WAIT=YESOne of these situations can result from the options and settings in this situation:3 Specify <strong>ACCESS</strong> locking, eliminating a lock out of yourself and other users.Because <strong>ACCESS</strong> can return inconsistent results to a table reader, specify<strong>ACCESS</strong> only if you are casually browsing data, not if you require precisedata.3 Change the scope of the lock from row-level to the entire table.3 Request that Teradata wait if it attempts to secure your lock and finds theresource already locked.3 Use <strong>SAS</strong>/<strong>ACCESS</strong> lock options to avoid contention.When you read or update a table, contention can occur: the DBMS is waiting <strong>for</strong>other users to release their locks on the table that you want to access. Thiscontention suspends your <strong>SAS</strong>/<strong>ACCESS</strong> session. In this situation, to avoidcontention during a read operation, you specify these <strong>SAS</strong>/<strong>ACCESS</strong> read lockoptions and values.3 READ_ISOLATION_LEVEL=READ3 READ_LOCK_TYPE=TABLE3 READ_MODE_WAIT=NOOne of these situations can result from the options and settings in this situation.3 Specify a READ lock.3 Change the scope of the lock. Because <strong>SAS</strong>/<strong>ACCESS</strong> does not support row lockingwhen you obtain the lock requested, you lock the entire table until your readoperation finishes.3 Tell <strong>SAS</strong>/<strong>ACCESS</strong> to fail the job step if Teradata cannot immediately obtain theREAD lock.ExamplesSetting the Isolation Level to <strong>ACCESS</strong> <strong>for</strong> Teradata Tables/* This generates a quick survey of unusual customer purchases. */libname cust teradata user=testuser password=testpassREAD_ISOLATION_LEVEL=<strong>ACCESS</strong>READ_LOCK_TYPE=TABLEREAD_MODE_WAIT=YESCONNECTION=UNIQUE;proc print data=cust.purchases(where= (bill1000));run;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!