Reputation: 47
I am trying to figure out a way to change the isolation level to read uncommitted (RU) prior to my query running from query builder, as I sometimes need to get data from operational tables.
Is there a way to do this in SAS Enterprise Guide? I know in the Options menu, there is a place to run custom code before task and query code, but I don't know what to enter here to make this happen.
Thanks!
Upvotes: 1
Views: 454
Reputation: 12691
The answer - it depends. The part where you force an uncommitted read is configured in the libname definition. If your libname is defined in metadata, then no - you can't do it in EG (at least not using a wizard), you'll need the library manager in SMC or DI studio.
If your libname is defined programmatically, then the syntax depends on what flavour of database you are using. For SQL Server, you'd need to add the following option: Read_Isolation_Level=RU
.
Note that this can mean that you read 'dirty data' (see this communities thread).
Upvotes: 2
Reputation: 1804
In your Auto load program that defines the libraries; you just need to know the name of the SQL library you want to query. Then do the following steps:
If the libname of the SQL library is called 'SQL' and the table you want to query is 'ORDERS'; you use PROC SQL
which is very similar to MS-SQL, then click run or F8.
proc sql;
select id, sum(sales) as total_sales
from SQL.ORDERS
group by id
;
quit;
Example
Step 1:
Upvotes: 0