<?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: Error with passthrough to oracle in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522431#M141832</link>
    <description>&lt;P&gt;Thanks all,&lt;/P&gt;
&lt;P&gt;Any suggestions about using LIKE with wilde card % in Oracle?&lt;/P&gt;</description>
    <pubDate>Wed, 19 Dec 2018 05:17:56 GMT</pubDate>
    <dc:creator>ammarhm</dc:creator>
    <dc:date>2018-12-19T05:17:56Z</dc:date>
    <item>
      <title>Error with passthrough to oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522407#M141818</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;
&lt;P&gt;I am using the following code to connect ot oracle:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
connect using datax as oracle;
create table combined_user as
select 
	*
	
from connection to oracle
	(
	select distinct 
		*
	from datax.dbo.process a left join datax.dbo.users b 
	  on a.id=b.id and a.location=b.location
	);
quit;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is working fine without issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Due to problems with id coding, I needed to remove some punctuations in the column id from the first table. i tried the following&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 using datax as oracle;
create table combined_user as
select 
	*
	
from connection to oracle
	(
	select distinct 
		*
	from datax.dbo.process a left join datax.dbo.users b 
	  on compress(a.id,,'p')=b.id and a.location=b.location
	);
quit;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which generated an error, possibly because oracle does not understand the command compress.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions on how to solve this? I tried reg_replace but with no luck&lt;/P&gt;
&lt;P&gt;Another question, is there anything in oracle that can do something similar to matching by "like"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	(
	select distinct 
		*
	from datax.dbo.process a left join datax.dbo.users b 
	  on compress(a.id,,'p') &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;like&lt;/STRONG&gt;&lt;/FONT&gt; b.id and a.location=b.location
	);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Am&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 02:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522407#M141818</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2018-12-19T02:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error with passthrough to oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522411#M141819</link>
      <description>&lt;P&gt;Your question has the answer in it. You cannot use the sas functions inside the SQL Pass-thru query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should perhaps use the Oracle equivalent for compress which is TRIM , which removes the leading and trailing blanks and you can also add the punctuation to the list of characters to the TRIM function which you are trying to remove in the query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 02:30:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522411#M141819</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2018-12-19T02:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error with passthrough to oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522413#M141820</link>
      <description>&lt;P&gt;You can't use SAS function in an Oracle query, just like you can't use Oracle functions in a SAS query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;replace(translate(ID, '.,-:+*/;', '#'), '#', '')
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;does what you want.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 02:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522413#M141820</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-12-19T02:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error with passthrough to oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522415#M141822</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;regexp_replace(ID, '[-.,:+*/;]') &lt;/PRE&gt;
&lt;P&gt;works too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 02:46:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522415#M141822</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-12-19T02:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error with passthrough to oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522416#M141823</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc sql;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;connect using datax as oracle;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;create table combined_user as&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;select *&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;from connection to oracle&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; (&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; &lt;FONT color="#FF0000"&gt;select distinct &lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;*&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt; from datax.dbo.process a left join datax.dbo.users b &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#FF0000"&gt; on compress(a.id,,'p')=b.id and a.location=b.location&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt; )&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT color="#3366FF"&gt;order by 1&lt;/FONT&gt;;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;quit;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just a reminder:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The code in blue runs in SAS and requires SAS syntax.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The code in red runs in Oracle and requires Oracle&amp;nbsp;syntax.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 02:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522416#M141823</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-12-19T02:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error with passthrough to oracle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522431#M141832</link>
      <description>&lt;P&gt;Thanks all,&lt;/P&gt;
&lt;P&gt;Any suggestions about using LIKE with wilde card % in Oracle?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 05:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-with-passthrough-to-oracle/m-p/522431#M141832</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2018-12-19T05:17:56Z</dc:date>
    </item>
  </channel>
</rss>

