SAS Enterprise Guide

Desktop productivity for business analysts and programmers
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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