BookmarkSubscribeRSS Feed
Stony_Creek
Calcite | Level 5
I wanted to use a Oracle hint in my query in EG but don't know how to approach. Any suggestion? Thanks!
1 REPLY 1
deleted_user
Not applicable
This can be done. I have done this, years ago.

1) You have to use the proc sql pass-through form of connection to Oracle

[pre]
proc sql;
connect to oracle as mycon (user=testuser password=testpass preserve_comments);
select *
from connection to mycon
(select /* +indx(empid) all_rows */
count(*) from employees);
quit;
[/pre]

2)
In the Oracle connection string, there is a required option

from "help" for SAS/ACCESS for Oracle, pass-through facility

PRESERVE_COMMENTS
enables you to pass additional information (called hints) to Oracle for processing. These hints might direct the Oracle query optimizer to choose the best processing method based on your hint.

You specify PRESERVE_COMMENTS as an argument in the CONNECT statement. Then you specify the hints in the CONNECTION TO component's Oracle SQL query. The hints are entered as comments in the SQL query and are passed to and processed by Oracle.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1388 views
  • 0 likes
  • 2 in conversation