<?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 SAS/SQL Error in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-SQL-Error/m-p/211421#M52217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using PROC Sql Pass-through facility in SAS by connecting to Oracle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having the problem when I run the query on UNIX.&lt;/P&gt;&lt;P&gt;Query works fine on Windows platform My query has following lines in the where statement that causes the error:(Rec_date has a datetime format)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; connect to oracle(user=xxx orapw="xyz" path="abc&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;");&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;create table test_tbl as &lt;/P&gt;&lt;P&gt;select * &lt;/P&gt;&lt;P&gt;from connection to oracle&amp;nbsp; (&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *&amp;nbsp;&amp;nbsp;&amp;nbsp; from test &lt;/P&gt;&lt;P&gt;where trunc(x.rec_date) between trunc(nvl(a.eff_dt, '01-JAN-1900')) and trunc(nvl(b.end_dt, '31-DEC-9999')) );&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: ORACLE execute error: ORA-01858: a non-numeric character was found where a numeric was expected.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate any help in this..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 May 2015 17:32:44 GMT</pubDate>
    <dc:creator>pp2014</dc:creator>
    <dc:date>2015-05-07T17:32:44Z</dc:date>
    <item>
      <title>SAS/SQL Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-SQL-Error/m-p/211421#M52217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using PROC Sql Pass-through facility in SAS by connecting to Oracle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having the problem when I run the query on UNIX.&lt;/P&gt;&lt;P&gt;Query works fine on Windows platform My query has following lines in the where statement that causes the error:(Rec_date has a datetime format)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; connect to oracle(user=xxx orapw="xyz" path="abc&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;");&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;create table test_tbl as &lt;/P&gt;&lt;P&gt;select * &lt;/P&gt;&lt;P&gt;from connection to oracle&amp;nbsp; (&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *&amp;nbsp;&amp;nbsp;&amp;nbsp; from test &lt;/P&gt;&lt;P&gt;where trunc(x.rec_date) between trunc(nvl(a.eff_dt, '01-JAN-1900')) and trunc(nvl(b.end_dt, '31-DEC-9999')) );&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: ORACLE execute error: ORA-01858: a non-numeric character was found where a numeric was expected.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate any help in this..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 17:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-SQL-Error/m-p/211421#M52217</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2015-05-07T17:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/SQL Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-SQL-Error/m-p/211422#M52218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error is of Oracle with the error code 01858.&lt;/P&gt;&lt;P&gt;This error can be because the data types of your columns are not date.&lt;/P&gt;&lt;P&gt;Also I don't see any unit of measure with your truncate function as well. Are you trying to truncate date-time field to date?&lt;/P&gt;&lt;P&gt;Also, is it the same query you are trying to run?&lt;/P&gt;&lt;P&gt;Because I don’t see any alias name for the tables referred as 'a' , 'b' and 'x'. And if it is just an example and rec_date is date-time format then try nvl function with a date-time replacement, such as '31-dec-9999:00:00:00'.&lt;/P&gt;&lt;P&gt;It would be helpful if you can provide your requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 02:46:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-SQL-Error/m-p/211422#M52218</guid>
      <dc:creator>Hercules</dc:creator>
      <dc:date>2015-05-08T02:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS/SQL Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-SQL-Error/m-p/211423#M52219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The nvl is an oracle function and you are getting an oracle error. Something is wrong with Oracle.&amp;nbsp; Most likey the input data is not as expected with x.rec_date an/or b.end_dt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 05:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-SQL-Error/m-p/211423#M52219</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-05-08T05:15:46Z</dc:date>
    </item>
  </channel>
</rss>

