<?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: Writing to an SQL database in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16887#M15396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the sense that you want to have the database 'auto update' when edits are made to the JMP table (with no 'Update' button, as such). You might be able to do this using 'Subscribe()'. See 'Help &amp;gt; Scripting Index' for examples.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Feb 2016 09:52:31 GMT</pubDate>
    <dc:creator>ian_jmp</dc:creator>
    <dc:date>2016-02-15T09:52:31Z</dc:date>
    <item>
      <title>Writing to an SQL database</title>
      <link>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16883#M15392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SQL connection in JMP is great for reading data - is anyone using it to write data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a stored procedure which gathers data and writes it to a new table. It uses a second table to read the list of parameters so it knows what data to collect. I can read this table with JMP but writing to it is far from easy:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;the text columns are saved as in JMP nvarchar with trailing white spaces - this requires a white space trim function to use the uploaded text columns&lt;/LI&gt;&lt;LI&gt;dates download correctly but the OBDC driver throws an error if you try to write them as dates. You can get round this by first converting the column to text format and then converting back on use but is rather annoying.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I use a stored procedure to copy the correct data from the JMP created table to the master table which overcomes the limitations indirectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is there a better way to use JSL/SQL together to read a table, add new rows and then write the alterations/amendments back to the server?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 15:34:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16883#M15392</guid>
      <dc:creator>stephen_pearson</dc:creator>
      <dc:date>2016-02-12T15:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to an SQL database</title>
      <link>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16884#M15393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I can't help, I'm completely novice to this subject, but I would also appreciate any feedback anyone has on writing to databases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 17:10:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16884#M15393</guid>
      <dc:creator>msharp</dc:creator>
      <dc:date>2016-02-12T17:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to an SQL database</title>
      <link>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16885#M15394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked Fine for me.&amp;nbsp; I am probably misunderstanding your question. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;dbc = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #0000dd;"&gt;Create Database Connection&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;"DRIVER=SQL SERVER;SERVER=fake_database;Database=Test_DB"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;sqlreturn = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #0000dd;"&gt;Execute SQL&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(dbc, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;"INSERT INTO [Test_DB].[dbo].[fake]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt; VALUES&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ('TestSQLinsert'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,'JMP'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,14.14&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,14.14&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,'JMP'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,'JMP'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,'JMP'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,14&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,14&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #0000dd;"&gt;close database connection&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(dbc);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10955_pastedImage_4.png" style="width: 767px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2728iBECBA99FBDE32426/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10955_pastedImage_4.png" alt="10955_pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;I assume your dates problem is because JMP actually stores dates as seconds.&amp;nbsp; You could either do a MDYHMS() on your date in JMP or do a date add(JMPdate, s, '1-1-1970') in SQL.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;Any more information you can give?&amp;nbsp; I can pull in data and add rows to the JMP table then update the SQL table but without context I would just skip the data pull and insert directly in SQL (Or have SQL do the addition and leave JMP out entirely).&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 01:52:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16885#M15394</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2016-10-19T01:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to an SQL database</title>
      <link>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16886#M15395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that example. I knew I could write raw SQL and execute it eg INSERT, UPDATE and REPLACE or run a stored procedure and pass parameters to it. I was looking for example SQL/JSL where a user can open an existing database table in JMP. To the end user it appears to be just a JMP table stored on a remote computer. The difference being any changes they made to that JMP table could be uploaded to the original database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can now see how I could write JSL code to check if new rows had been added to the table and then use INSERT INTO to write them to the database (provided the data type mismatches can be controlled). Any ideas how to keep track of edits to existing rows?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Feb 2016 16:02:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16886#M15395</guid>
      <dc:creator>stephen_pearson</dc:creator>
      <dc:date>2016-02-13T16:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to an SQL database</title>
      <link>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16887#M15396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the sense that you want to have the database 'auto update' when edits are made to the JMP table (with no 'Update' button, as such). You might be able to do this using 'Subscribe()'. See 'Help &amp;gt; Scripting Index' for examples.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 09:52:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16887#M15396</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2016-02-15T09:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to an SQL database</title>
      <link>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16888#M15397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you're querying what the data table is with some WHERE statement and not just pulling in the whole table?&amp;nbsp; &lt;/P&gt;&lt;P&gt;If you do happen to be pulling in the whole table,&lt;/P&gt;&lt;P&gt;dt &amp;lt;&amp;lt; Save Database(&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; dbc,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; "dbo.fake",&lt;/P&gt;&lt;P&gt;&amp;nbsp; Replace&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would work. Otherwise DON'T do this.&amp;nbsp; As it will delete all information in your table that isn't in your JMP query. I think this is in JMP 12+?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, you could split it off of if it has an ID or not.&amp;nbsp; Do an update if it has an ID, do an insert if it doesn't.&amp;nbsp; It would probably be best to lock and hide the ID column though.&amp;nbsp; I'm just spitballing here but I think it should work.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 15:33:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/16888#M15397</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2016-02-15T15:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to an SQL database</title>
      <link>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/230232#M45665</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your sharing.&lt;/P&gt;&lt;P&gt;Below is my case, and appreciate for help.&lt;/P&gt;&lt;P&gt;1. the sql data base name in server: SQL_machine_yield_db&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;attached&amp;nbsp;SQL_machine_yield_db.jmp when get update from db connection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. in the db, there are 8 columns&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;3. the data in the table "new_and_update_yield.jmp&lt;/P&gt;&lt;P&gt;Question: how to use&amp;nbsp; jsl/sql to update new_and_yield.jmp to&amp;nbsp;SQL_machine_yield_db in the server?&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 23:53:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/230232#M45665</guid>
      <dc:creator>wu</dc:creator>
      <dc:date>2019-10-22T23:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to an SQL database</title>
      <link>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/670500#M85845</link>
      <description>&lt;P&gt;thank you &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2610"&gt;@vince_faller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have used this and also manage to scale it up by running it in a loop. for some reason i had a limit of about 35K rows at a time so i just made a for loop to read 25K rows at a time and enter them into the database.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 10:39:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Writing-to-an-SQL-database/m-p/670500#M85845</guid>
      <dc:creator>ron_horne</dc:creator>
      <dc:date>2023-08-23T10:39:10Z</dc:date>
    </item>
  </channel>
</rss>

