<?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: Time Fields using SQL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Time-Fields-using-SQL/m-p/35458#M8749</link>
    <description>Your example shows SQL pass-thru. What happends if you use LIBANME instead?&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
    <pubDate>Thu, 28 May 2009 06:22:08 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2009-05-28T06:22:08Z</dc:date>
    <item>
      <title>Time Fields using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Time-Fields-using-SQL/m-p/35455#M8746</link>
      <description>Hi Guys,&lt;BR /&gt;
&lt;BR /&gt;
I am linked to oracle tables and am attempting to retireve the contents of said table using SQL.  My problem is that I can't get date/times to work.  By saying this I mean that I recieve the following error whenever I attempt to access date/time data.&lt;BR /&gt;
&lt;BR /&gt;
ERROR: Prepare error: ICommandPrepare::Prepare failed. &lt;BR /&gt;
SQL statement SELECT&lt;BR /&gt;
		TransactionsTable.TransactionID,&lt;BR /&gt;
		TransactionsTable.CheckID,&lt;BR /&gt;
                                TransactionsTable.UpdateTime&lt;BR /&gt;
&lt;BR /&gt;
	FROM&lt;BR /&gt;
		TransactionsTable&lt;BR /&gt;
&lt;BR /&gt;
The below code is what I am attempting to run.  Does anyone know how I can complete this task successfully.&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your help.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
	CONNECT TO oledb AS oradb&lt;BR /&gt;
	  (User=XXXXXXX    Password=XXXXXXX DataSource=XXXXXXXXXXXXXXX provider=MSDAORA.1 );;&lt;BR /&gt;
	CREATE table CmovTrans_Dat &lt;BR /&gt;
	AS SELECT * FROM connection to oradb &lt;BR /&gt;
	(SELECT&lt;BR /&gt;
		TransactionsTable.TransactionID,&lt;BR /&gt;
		TransactionsTable.CheckID,&lt;BR /&gt;
                                TransactionsTable.UpdateTime&lt;BR /&gt;
&lt;BR /&gt;
	FROM&lt;BR /&gt;
		TransactionsTable&lt;BR /&gt;
	);&lt;BR /&gt;
	DISCONNECT FROM oradb;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 21 May 2009 23:56:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Time-Fields-using-SQL/m-p/35455#M8746</guid>
      <dc:creator>Scottcom4</dc:creator>
      <dc:date>2009-05-21T23:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Time Fields using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Time-Fields-using-SQL/m-p/35456#M8747</link>
      <description>It's not clear to me, but are you able to execute successfully with the most basic connection to your Oracle environment from SAS.  Also, consider your SAS version and service pack maintenance level - I found several hits on the SAS support website, using the Google advanced search argument below:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sql oracle prepare error site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 27 May 2009 21:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Time-Fields-using-SQL/m-p/35456#M8747</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-27T21:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Time Fields using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Time-Fields-using-SQL/m-p/35457#M8748</link>
      <description>Hi Scott,&lt;BR /&gt;
&lt;BR /&gt;
Yes you are correct in your understanding, I am able to access the Oracle tables using Proc SQL, however as soon as I add a time or date variable I begin to get errors.  My work around for the date issue was to use to_char(&lt;I&gt;Varname1&lt;/I&gt;), howeever this did not work for the time and date variables.  I gather there is a better alternative to using to_char, however at this stage it works as desired.&lt;BR /&gt;
&lt;BR /&gt;
Thank you for the google search criteria.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Scott</description>
      <pubDate>Thu, 28 May 2009 04:43:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Time-Fields-using-SQL/m-p/35457#M8748</guid>
      <dc:creator>Scottcom4</dc:creator>
      <dc:date>2009-05-28T04:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Time Fields using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Time-Fields-using-SQL/m-p/35458#M8749</link>
      <description>Your example shows SQL pass-thru. What happends if you use LIBANME instead?&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Thu, 28 May 2009 06:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Time-Fields-using-SQL/m-p/35458#M8749</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-05-28T06:22:08Z</dc:date>
    </item>
  </channel>
</rss>

