<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Oracle passthrough syntax frustration in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459176#M70212</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46599"&gt;@DougZ&lt;/a&gt;&amp;nbsp;I don't understand what you are saying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; First, SAS should be implementing whatever Oracle implements as its SQL, not the ANSI form.&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Not it shouldn't. I have&amp;nbsp;&lt;SPAN&gt;SAS/Access to Oracle,&amp;nbsp;SAS/Access to Teradata,&amp;nbsp;SAS/Access to DB2 on my server.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I do not want the SAS language to change, and which functions should it then implement? Teradata's or IBM's version?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; I am not using a SAS libname here;&amp;nbsp;&amp;nbsp;this is an Oracle passthrough code block.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Using a libname does not mean explicit pass-through. You only do explicit pass-through when you submit code using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;execute by&amp;nbsp;&lt;/FONT&gt; or&amp;nbsp;&lt;FONT face="courier new,courier"&gt; from connection to&lt;/FONT&gt; .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; since my SQL runs when using Squirrel [], my Oracle DBAs will say, "That's a SAS problem".&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;If you use explicit pass-through, and as long as they point to the same libname schema, &lt;STRONG&gt;the same SQL queries that run in&amp;nbsp;Squirrel&amp;nbsp;will run from SAS. Period.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you don't, you then run SAS code, and you must use SAS syntax. And you can leverage SAS functions in your SQL, like intnx() or putn().&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SAS has over 500 functions when Oracle stays in the double digits, so I must prefer the richness of SAS thank you very much.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You don't expect Oracle to understand SAS syntax, and likewise SAS has it own syntax, different&amp;nbsp;from that of Oracle, SQL Server, Hive, DB2, MySQL, etc.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You really must understand the difference between implicit and explicit pass-through. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You'll then reap the benefits of both words when you use the strengths of each, like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;proc sql;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; connect using ORALIB;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;/* sas-only syntax here */&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; create table TAB as select&lt;STRONG&gt; intnx(...)&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;/* sas function&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; from connection to ORALIB&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; (&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;select&amp;nbsp; ...&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;/* oracle-only syntax here */&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;&amp;nbsp;rank() over(...)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* oracle window function&amp;nbsp; */&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; );&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 02 May 2018 04:19:06 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-05-02T04:19:06Z</dc:date>
    <item>
      <title>Oracle passthrough syntax frustration</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459063#M70196</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Here's the background.&amp;nbsp; I'm on Linux 9.4 (TS1M3) and I want to run a set of my users' typical queries via SAS/Access for Oracle from a cron job, then store the results (in&amp;nbsp;perm SAS file) hourly to monitor performance over time.&amp;nbsp; The first query I have started with has a couple variables that may change next year, so I decided to put it into a macro with parameters for those vars.&amp;nbsp; The macro(s) will be called from within the Proc SQL block.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I'm running into a lot of unexpected issues.&amp;nbsp; Apparently SAS/Access for Oracle (despite SAS's rich annual fees) doesn't recognize Oracle SQL very well.&amp;nbsp; For example,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;select clean_book_ind, book_type, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case when gov_ind = 'F' and risk_type_cd not in ('FMG','FNG','GNF','GNV','GNR') then 'FHAP' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else 'OTHER' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end private_ind, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum(balance) upb ... (etc)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;had to be changed to include "as" for the tags:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;select clean book_ind, book_type, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case when gov_ind = 'F' and risk_type_cd not in ('FMG','FNG','GNF','GNV','GNR') then 'FHAP' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else 'OTHER' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end &lt;/SPAN&gt;&lt;SPAN style="color: red; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.5pt;"&gt;AS &lt;/SPAN&gt;&lt;SPAN&gt;private_ind, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum(balance) &lt;/SPAN&gt;&lt;SPAN style="color: red; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.5pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN&gt; upb ... (etc)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;so for a lengthy query there is a lot of manual re-work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then I couldn't pass in a single-ticks date:&lt;/SPAN&gt;&lt;SPAN&gt; where asset_date = %bquote('&amp;amp;asset_date')... (it was '31jan2018) I had to use %unquote(%bquote('&amp;amp;asset_date')).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Next, having cleaned up those issues, I got &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: ORACLE prepare error: ORA-24333: zero iteration count.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Googled it, got to Usage Note 15432: "ORA-24333: zero iteration count" error, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tried that kind of syntax,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(proc sql;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; connect to oracle (user=scott pw=tiger);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; execute (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table newemp as select * from emp&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ) by oracle;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; disconnect from oracle;&lt;BR /&gt;&amp;nbsp;quit;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(unfortunately no "create table work.blahblah as select * from connection to oracle"&amp;nbsp; lines) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and am now getting &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: red; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.5pt;"&gt;ERROR: ORACLE execute error: ORA-00900: invalid SQL statement&lt;/SPAN&gt;&lt;SPAN&gt;" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but then I copied the SQL statement from my SAS log, pasted it into my Windows SQL Client (Squirrel) and it ran just fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yep, I am frustrated with this product - it's not living up to the reputation it *should* have for the money we are paying - and&lt;STRONG&gt; I don't know what to do next.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 19:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459063#M70196</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2018-05-01T19:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle passthrough syntax frustration</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459101#M70199</link>
      <description>I can understand you frustration, but I think we need to sort some things up.&lt;BR /&gt;I believe your first code excerpt is using SAS SQL, accessing a SAS libname, that just happen in this case to be Oracle. SAS SQL complies with the ANSI 92 standard. So for this case, I think you just have to accept the RDBMS AGNOSTIC approach of SAS.&lt;BR /&gt;&lt;BR /&gt;For explicit SQL pass through, anything that goes inside the execute block is totally out of SAS control. What your problem is in this case is hard to tell by the information provided, but using the Oracle DBA would be my first option.</description>
      <pubDate>Tue, 01 May 2018 20:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459101#M70199</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-05-01T20:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle passthrough syntax frustration</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459105#M70200</link>
      <description>&lt;P&gt;Linus,&lt;/P&gt;&lt;P&gt;thank you for replying - much appreciated!!&lt;/P&gt;&lt;P&gt;But I don't think it's correct.&amp;nbsp; First, SAS should be implementing whatever Oracle implements as its SQL, not the ANSI form that causes errors.&amp;nbsp; That is what I am paying SAS for -- "SAS/Access for Oracle".&lt;/P&gt;&lt;P&gt;Next, I am not using a SAS libname here;&amp;nbsp;&amp;nbsp;this is an Oracle passthrough code block.&lt;/P&gt;&lt;P&gt;Finally, since my SQL runs when using Squirrel or Oracle SQL Developer Windows software, my Oracle DBAs will say, "That's a SAS problem, not an Oracle problem" - and they're right.&lt;/P&gt;&lt;P&gt;Still frustrated...&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 20:56:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459105#M70200</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2018-05-01T20:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle passthrough syntax frustration</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459134#M70207</link>
      <description>&lt;P&gt;OK - I solved it.&amp;nbsp; The &lt;FONT color="#ff0000" face="Courier New"&gt;ORA-00900: invalid SQL statement&lt;/FONT&gt; message went away after I switched my&amp;nbsp;program parameters to point to the correct database&amp;nbsp; : o&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My frustration with the "SAS/Access for Oracle" product still stands.&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 22:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459134#M70207</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2018-05-01T22:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle passthrough syntax frustration</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459150#M70209</link>
      <description>&lt;P&gt;SAS actually doesn't really recognize Oracle SQL syntax at all, and that's by design.&amp;nbsp; SAS talks to Oracle with either implicit pass-through SQL, in which case your code is SAS SQL only, or you use explicit pass-through SQL and then SAS doesn't do anything except pass the Oracle SQL code you specify on verbatim (well after doing any macro processing).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   connect to oracle (user=scott pw=tiger);
   execute (
     create table newemp as select * from emp
   ) by oracle;
   disconnect from oracle;
 quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also, the above code you provided wouldn't result in&amp;nbsp;&lt;SPAN&gt;"create table work.blahblah as select * from connection to oracle", it's explicit pass-through SQL, so you'd be creating the table in your Oracle DB, not in SAS at all.&amp;nbsp; SAS has no idea what your doing, it's just a dumb pipe in this instance.&amp;nbsp; Depending on your SQL_TRACE options you may see some diagnostic info in the SAS log though.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I do have issues with quoting between Oracle and SAS though, primarily because I use tons of macros and Oracle requires everything to be single quoted and SAS won't resolve macro vars inside single quotes.&amp;nbsp; I generally just leave my macro vars unquoted and slap&amp;nbsp;%STR(%') before and after any text I want to send to Oracle.&amp;nbsp; That takes care of 98% of the problems I've had, the other times I have to be a bit more creative.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 23:52:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459150#M70209</guid>
      <dc:creator>Sven111</dc:creator>
      <dc:date>2018-05-01T23:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle passthrough syntax frustration</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459176#M70212</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46599"&gt;@DougZ&lt;/a&gt;&amp;nbsp;I don't understand what you are saying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; First, SAS should be implementing whatever Oracle implements as its SQL, not the ANSI form.&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Not it shouldn't. I have&amp;nbsp;&lt;SPAN&gt;SAS/Access to Oracle,&amp;nbsp;SAS/Access to Teradata,&amp;nbsp;SAS/Access to DB2 on my server.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I do not want the SAS language to change, and which functions should it then implement? Teradata's or IBM's version?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; I am not using a SAS libname here;&amp;nbsp;&amp;nbsp;this is an Oracle passthrough code block.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Using a libname does not mean explicit pass-through. You only do explicit pass-through when you submit code using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;execute by&amp;nbsp;&lt;/FONT&gt; or&amp;nbsp;&lt;FONT face="courier new,courier"&gt; from connection to&lt;/FONT&gt; .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; since my SQL runs when using Squirrel [], my Oracle DBAs will say, "That's a SAS problem".&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;If you use explicit pass-through, and as long as they point to the same libname schema, &lt;STRONG&gt;the same SQL queries that run in&amp;nbsp;Squirrel&amp;nbsp;will run from SAS. Period.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you don't, you then run SAS code, and you must use SAS syntax. And you can leverage SAS functions in your SQL, like intnx() or putn().&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SAS has over 500 functions when Oracle stays in the double digits, so I must prefer the richness of SAS thank you very much.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You don't expect Oracle to understand SAS syntax, and likewise SAS has it own syntax, different&amp;nbsp;from that of Oracle, SQL Server, Hive, DB2, MySQL, etc.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You really must understand the difference between implicit and explicit pass-through. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You'll then reap the benefits of both words when you use the strengths of each, like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;proc sql;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; connect using ORALIB;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;/* sas-only syntax here */&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; create table TAB as select&lt;STRONG&gt; intnx(...)&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;/* sas function&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; from connection to ORALIB&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; (&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;select&amp;nbsp; ...&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;/* oracle-only syntax here */&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;&amp;nbsp;rank() over(...)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* oracle window function&amp;nbsp; */&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; );&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 04:19:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Oracle-passthrough-syntax-frustration/m-p/459176#M70212</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-05-02T04:19:06Z</dc:date>
    </item>
  </channel>
</rss>

