In the Query Builder task, you have the option to Generate source for explicit pass-through. When this option is selected, SAS Enterprise Guide sometimes generates incorrect SQL code.
Here are two causes of this problem:
- The code might be incorrect if you select the Use AuthDomain Option, you enter a Name that includes blank spaces, and you do not enclose the value within quotation marks. In this case, the code looks like this example:
PROC SQL;
CONNECT TO ORACLE as con1
(READBUFF=10000 ACCESS=READONLY PATH=LIQ80 authdomain=example OraAuth);
Because the quotation marks are missing, the SQL procedure fails with an error. To avoid this issue, include quotation marks when you enter a Name that includes blank spaces.
- The code might be incorrect if your library has been defined in metadata with the option ACCESS=READONLY (Input/Output ► Data access level for a connection). In this case, the ACCESS=READONLY option is automatically entered into the Options field on the Pass-through tab. When this option is present, the automatically generated SQL code fails with this error:
PROC SQL;
CONNECT TO ORACLE as con1
(READBUFF=10000 ACCESS=READONLY PATH=LIQ80 authdomain=example_OraAuth);
ERROR: Invalid option name Access
To avoid this error, remove ACCESS=READONLY from the Options field.