<?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 script into sql in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/515598#M74229</link>
    <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I always need to turn a list into a format that can run as sql, like this:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;LIST&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;STRONG&gt;into&amp;nbsp;&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; in('A','B','C','D','E')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, I have to use 'query builder-&amp;gt;filter the table-&amp;gt;select from a list' then copy the [ in('A','B','C','D','E')&amp;nbsp; ] from there. Is there a scripting way that I can use as template no matter what list I work on? Like I run the same code then get the list in sql way. Very trouble to click through all the way to get it every day. Thanks so much!&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 17:02:51 GMT</pubDate>
    <dc:creator>Isabel26</dc:creator>
    <dc:date>2023-06-09T17:02:51Z</dc:date>
    <item>
      <title>script into sql</title>
      <link>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/515598#M74229</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I always need to turn a list into a format that can run as sql, like this:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;LIST&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;STRONG&gt;into&amp;nbsp;&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; in('A','B','C','D','E')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, I have to use 'query builder-&amp;gt;filter the table-&amp;gt;select from a list' then copy the [ in('A','B','C','D','E')&amp;nbsp; ] from there. Is there a scripting way that I can use as template no matter what list I work on? Like I run the same code then get the list in sql way. Very trouble to click through all the way to get it every day. Thanks so much!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:02:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/515598#M74229</guid>
      <dc:creator>Isabel26</dc:creator>
      <dc:date>2023-06-09T17:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: script into sql</title>
      <link>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/515613#M74232</link>
      <description>&lt;P&gt;The Concat Items() function should give you what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;theList = {"A","B","C","D","E"};
inString = concat items(theList,",");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jun 2022 13:58:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/515613#M74232</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-06-29T13:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: script into sql</title>
      <link>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/515628#M74234</link>
      <description>&lt;P&gt;Thanks and this will put list in the format, but my list normally has thousands entries, and that is impossible to put in theList ={};&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 14:14:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/515628#M74234</guid>
      <dc:creator>Isabel26</dc:creator>
      <dc:date>2022-06-29T14:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: script into sql</title>
      <link>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/515689#M74244</link>
      <description>&lt;P&gt;In my first response, I was actually just pointing you to the Concat Items() function, so you would have it to possibly work into your solution.&amp;nbsp; You did not provide what the structure of the "LIST" input actually was.&amp;nbsp; So guessing again, here is the same function being used but with the "LIST" not being in the form of a JMP List, but instead coming from a data table column called "name".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a slight modification that takes the list from a data column.&amp;nbsp; The column can be as long as you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );

inString = "'" || Concat Items( dt:name &amp;lt;&amp;lt; get values, "','" ) || "'";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jun 2022 16:11:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/515689#M74244</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-06-29T16:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: script into sql</title>
      <link>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/516325#M74286</link>
      <description>&lt;P&gt;This works fine and thanks for the reply. Yes the NAME column is what I mean. I do find out that it stopped instring after about 400 rows. So, it will work for data less than 400 rows, but still a problem for larger data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 17:15:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/516325#M74286</guid>
      <dc:creator>Isabel26</dc:creator>
      <dc:date>2022-06-30T17:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: script into sql</title>
      <link>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/516402#M74298</link>
      <description>&lt;P&gt;If you have that many comparisons to make, most of the time, I upload a table through SQL to the database.&amp;nbsp; I then join the comparison table with the table of interest, and then I&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 20:00:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-into-sql/m-p/516402#M74298</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-06-30T20:00:08Z</dc:date>
    </item>
  </channel>
</rss>

