<?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: Proc SQL connect to ODBC in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/243010#M55884</link>
    <description>&lt;P&gt;Please note my sample used select * not create table to try to avoid your error. Did you still get the same error?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jan 2016 18:39:31 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2016-01-12T18:39:31Z</dc:date>
    <item>
      <title>Proc SQL connect to ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/242819#M55864</link>
      <description>&lt;P&gt;The test connection is successful in the datasources (ODBC), but when I try uploading the table, it gives me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: PROC SQL requires any created table to have at least 1 column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don;t understand this error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;connect to odbc (user=xxx password=xxx&amp;nbsp;datasrc=xxx);&lt;BR /&gt;create table rwork.xxx_xxx as select * from connection to odbc (&lt;BR /&gt; SELECT *&lt;BR /&gt; FROM dbo.v_xxx_xxx&lt;BR /&gt; WHERE Period_Id=&amp;amp;date_ncr.&lt;BR /&gt;);&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 22:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/242819#M55864</guid>
      <dc:creator>J_C</dc:creator>
      <dc:date>2016-01-11T22:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL connect to ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/242831#M55867</link>
      <description>&lt;P&gt;What do you mean by uploading the table? Does the SAS LIBREF RWORK refer to a SAS library or a non-SAS datasource?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you run the following test does it give you at least one data column?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql outobs = 10;
connect to odbc (user=xxx password=xxx datasrc=xxx);
select * from connection to odbc (
SELECT *
FROM dbo.v_xxx_xxx
WHERE Period_Id=&amp;amp;date_ncr.
);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 23:44:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/242831#M55867</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-01-11T23:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL connect to ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/242869#M55869</link>
      <description>&lt;P&gt;It is possible to replicate this error for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Libname sqlstage ODBC Schema=DBO DSN=sqlstage;
Proc SQL;
  *Drop Table sqlstage.Test_x_3;
  Create Table sqlstage.Test_x_3 (Var Float);
  Create Table sqlstage.Test_x_4 As Select * From sqlstage.Test_x_3 (Drop=Var);
Quit;

Gives:

ERROR: Table SQLSTAGE.Test_x_3 doesn't have any columns. PROC SQL requires each of its tables to have at least 1 column.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could it be that there actually are no columns or that the user simply hasn't the permission to access this table?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 07:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/242869#M55869</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2016-01-12T07:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL connect to ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/242915#M55872</link>
      <description>&lt;P&gt;SAS Kiwi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we reach into a databse to pull in&amp;nbsp;table dbo.v_xxx_xxx into a SAS dataset (this is what I meant by uploading). The SAS dataset we are creating from the dbo.v_xxx_xxx view will reside in a UNIX environement which is referenced by rwork. RWORK is defined and has always been working without any issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as for the sample you asked me to run (adding outobs=10), it provided me with the same error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 13:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/242915#M55872</guid>
      <dc:creator>J_C</dc:creator>
      <dc:date>2016-01-12T13:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL connect to ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/242941#M55875</link>
      <description>&lt;P&gt;Whenever there is doubt about the data source, and you ave an explicit&amp;nbsp;SQL - just try that SQL in the data source, using the same userid used in the connect to statement.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 14:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/242941#M55875</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-01-12T14:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL connect to ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/243010#M55884</link>
      <description>&lt;P&gt;Please note my sample used select * not create table to try to avoid your error. Did you still get the same error?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 18:39:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-connect-to-ODBC/m-p/243010#M55884</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-01-12T18:39:31Z</dc:date>
    </item>
  </channel>
</rss>

