<?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: append dataset to mysql server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525272#M142915</link>
    <description>Yes, I can pull information from the table in SAS code</description>
    <pubDate>Mon, 07 Jan 2019 22:56:30 GMT</pubDate>
    <dc:creator>leonzheng</dc:creator>
    <dc:date>2019-01-07T22:56:30Z</dc:date>
    <item>
      <title>append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525244#M142900</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am trying to upload data into an existing table in mysql database, using append.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Here is my code for data pulling with database information:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;libname DB&amp;nbsp;mysql user = userid&amp;nbsp;password = mypassword schema=dbschema server="thisistheserver.com" port = 3311;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc append base = DB.existingdata data =&amp;nbsp;have force;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It return error as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Prepare error: No database selected SQL statement: SELECT * FROM `existingdata`&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please help to check what is the problem with my "append" code, or if anyone can show me how to use insert into to do the job, it is also OK.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;BR /&gt;.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 21:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525244#M142900</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-07T21:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525249#M142902</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the base table exists in the database and you have permissions on it.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 21:57:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525249#M142902</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2019-01-07T21:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525250#M142903</link>
      <description>&lt;P&gt;As this is MySQL I would suggest:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname DB mysql user = userid password = mypassword &lt;STRONG&gt;DATABASE&lt;/STRONG&gt;=dbschema server="thisistheserver.com" port = 3311;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;-- Jan.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 21:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525250#M142903</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2019-01-07T21:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525252#M142904</link>
      <description>My userid and password should give me permission. I can upload data in JSL. But right now I need to combine that part of code into my SAS code</description>
      <pubDate>Mon, 07 Jan 2019 22:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525252#M142904</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-07T22:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525253#M142905</link>
      <description>Yes, that is what I used</description>
      <pubDate>Mon, 07 Jan 2019 22:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525253#M142905</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-07T22:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525255#M142906</link>
      <description>Can you access or see that table in the library?</description>
      <pubDate>Mon, 07 Jan 2019 22:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525255#M142906</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T22:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525256#M142907</link>
      <description>&lt;P&gt;If you rerun your code with the following options you get some insight in the dialog between SAS and MySQL. This may help with troubleshooting:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options sastrace=',,,d' sastraceloc=saslog;

libname ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 22:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525256#M142907</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2019-01-07T22:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525259#M142908</link>
      <description>&lt;P&gt;Here is the returned info&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;29&lt;BR /&gt;0 1546900232 no_name 0 APPEND&lt;BR /&gt;MYSQL_1: Executed: on connection 1 1 1546900232 no_name 0 APPEND&lt;BR /&gt;SELECT * FROM `existingdata` WHERE 0=1 2 1546900232 no_name 0 APPEND&lt;BR /&gt;3 1546900232 no_name 0 APPEND&lt;BR /&gt;4 1546900233 no_name 0 APPEND&lt;BR /&gt;MYSQL_2: Executed: on connection 2 5 1546900233 no_name 0 APPEND&lt;BR /&gt;SELECT * FROM `existingdata` where (0) 6 1546900233 no_name 0 APPEND&lt;BR /&gt;7 1546900233 no_name 0 APPEND&lt;BR /&gt;MYSQL: COMMIT performed on connection 2. 8 1546900233 no_name 0 APPEND&lt;BR /&gt;9 1546900233 no_name 0 APPEND&lt;BR /&gt;30 proc &lt;SPAN&gt;proc append base = DB.existingdata data =&amp;nbsp;have force;&lt;/SPAN&gt;&lt;BR /&gt;ERROR: Prepare error: No database selected SQL statement: SELECT * FROM `existingdata`.&lt;BR /&gt;31 run;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 22:32:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525259#M142908</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-07T22:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525260#M142909</link>
      <description>I cannot directly. But I can pull data from the table in mysql with the same information</description>
      <pubDate>Mon, 07 Jan 2019 22:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525260#M142909</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-07T22:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525263#M142911</link>
      <description>I'm not sure what "i can pull data form the table in mysql" means. Does this mean you can see the table in MySQL, but not in SAS?</description>
      <pubDate>Mon, 07 Jan 2019 22:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525263#M142911</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T22:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525266#M142913</link>
      <description>Sorry I couldn't explain myself clearly. I used to run my SAS code to get result. Then upload new dataset or pull the whole table from MySQL use JSL. Now I have to combine everything into SAS code. I tried pull whole table in a separate program and it worked, but uploading right now is not working. I think the access to the table in MySQL is OK, not sure if that is what you mean "see"</description>
      <pubDate>Mon, 07 Jan 2019 22:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525266#M142913</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-07T22:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525271#M142914</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/184299"&gt;@leonzheng&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Sorry I couldn't explain myself clearly. I used to run my SAS code to get result. Then upload new dataset or pull the whole table from MySQL use JSL. Now I have to combine everything into SAS code. I tried pull whole table in a separate program and it worked, but uploading right now is not working. I think the access to the table in MySQL is OK, not sure if that is what you mean "see"&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can you pull information from those tables in SAS? That's one way to&amp;nbsp;verify your assumption that your access is ok.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 22:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525271#M142914</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T22:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525272#M142915</link>
      <description>Yes, I can pull information from the table in SAS code</description>
      <pubDate>Mon, 07 Jan 2019 22:56:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525272#M142915</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-07T22:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525276#M142916</link>
      <description>&lt;P&gt;Here's how a SQL insert may work. The first data step is just to create a table to insert the data into.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data class;
set sashelp.class;
run;


proc sql;
insert into class
select * from sashelp.class;
quit;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 23:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525276#M142916</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T23:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525277#M142917</link>
      <description>&lt;P&gt;Follow your suggestion, I run code:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;libname DB&amp;nbsp;mysql user = userid&amp;nbsp;password = mypassword schema=dbschema server="thisistheserver.com" port = 3311;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;insert into DB.existingdata&lt;BR /&gt;select * from&amp;nbsp;have&amp;nbsp; &amp;nbsp; //also tried select * from existingdata here&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname&amp;nbsp;DB clear;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It still not working, show the same error:&amp;nbsp;&lt;SPAN&gt;Prepare error: No database selected SQL statement: SELECT * FROM `existingdata`&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 23:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525277#M142917</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-07T23:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525278#M142918</link>
      <description>For some reason it seems to be thinking the existing data doesn't exist or is trying to run everything on the server. That's the exact code you're using?&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Jan 2019 23:16:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525278#M142918</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T23:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525279#M142919</link>
      <description>I only changed the names I used for simplify reason</description>
      <pubDate>Mon, 07 Jan 2019 23:18:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525279#M142919</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-07T23:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525286#M142922</link>
      <description>Sounds like a tech support question then.</description>
      <pubDate>Mon, 07 Jan 2019 23:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525286#M142922</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T23:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525287#M142923</link>
      <description>thanks</description>
      <pubDate>Mon, 07 Jan 2019 23:50:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525287#M142923</guid>
      <dc:creator>leonzheng</dc:creator>
      <dc:date>2019-01-07T23:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: append dataset to mysql server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525322#M142934</link>
      <description>&lt;P&gt;Try&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data work.a;&lt;/P&gt;
&lt;P&gt;set&amp;nbsp;&lt;SPAN&gt;DB.existingdata;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then see what happens. If this works your libname works, else you have issue with libname, you need to contact someone in your team to ask what they use and fix it&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data db.a;&lt;/P&gt;
&lt;P&gt;set&amp;nbsp;work.a(obs=1)&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if above step does not work but your first step has worked then you have only read access to mysql table, but you do not write access. Which means you need to contact your database admin about this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 04:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/append-dataset-to-mysql-server/m-p/525322#M142934</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2019-01-08T04:18:55Z</dc:date>
    </item>
  </channel>
</rss>

