<?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: JSL get values from a table and make into a text string that can be used as an input in another datebase query in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-get-values-from-a-table-and-make-into-a-text-string-that-can/m-p/13319#M12572</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works great.&amp;nbsp; thanks so much for the help on this item.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jul 2015 22:55:32 GMT</pubDate>
    <dc:creator>chris_dennis</dc:creator>
    <dc:date>2015-07-29T22:55:32Z</dc:date>
    <item>
      <title>JSL get values from a table and make into a text string that can be used as an input in another datebase query</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-get-values-from-a-table-and-make-into-a-text-string-that-can/m-p/13317#M12570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;In my script I have multiple data base queries.&amp;nbsp;&amp;nbsp; From one query it get a column with a list of lot numbers.&amp;nbsp; I want to take the values from this column and make them into a local variable that I can use in the next data query to pull data from a different database. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;using a script line below I get the value string.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cassette = SLC:DESTINATION_CASS &amp;lt;&amp;lt; get values;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;&lt;EM&gt;result &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cassette = {"SPQ093146 1"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;How can I get rid of the "&lt;/EM&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;EM&gt;" from this item. This example only one value listed, but result could have multiple values&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 14:45:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-get-values-from-a-table-and-make-into-a-text-string-that-can/m-p/13317#M12570</guid>
      <dc:creator>chris_dennis</dc:creator>
      <dc:date>2015-07-15T14:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: JSL get values from a table and make into a text string that can be used as an input in another datebase query</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-get-values-from-a-table-and-make-into-a-text-string-that-can/m-p/13318#M12571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;STRONG&gt;get values&lt;/STRONG&gt; message returns a list.&amp;nbsp; You can refer to individual list elements using &lt;STRONG&gt;cassette[1]&lt;/STRONG&gt;, &lt;STRONG&gt;cassette[2]&lt;/STRONG&gt; etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there's an easier way to convert a set of values in a column to something usable.&amp;nbsp; I use this approach to create an &lt;STRONG&gt;IN LIST&lt;/STRONG&gt; for an Oracle &lt;STRONG&gt;SELECT&lt;/STRONG&gt; statement.&amp;nbsp; Use the &lt;STRONG&gt;concat items&lt;/STRONG&gt; function like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;slc &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;New Table&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Cassette Data"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; Add Rows&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;New Column&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"DESTINATION_CASS"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; Character&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; Nominal&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set Values&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"aa"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"bb"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"cc"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;}&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;cassette_list &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; slc&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;destination_cass &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;STRONG style="color: navy; font-family: 'Courier New';"&gt;get values&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green;"&gt;// Convert the list to an Oracle IN list&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;in_list &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"('"&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;||&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;Concat Items&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;cassette_list&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"', '"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;||&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"')"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the results:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;"('aa', 'bb', 'cc')"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 12:18:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-get-values-from-a-table-and-make-into-a-text-string-that-can/m-p/13318#M12571</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2015-07-27T12:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: JSL get values from a table and make into a text string that can be used as an input in another datebase query</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-get-values-from-a-table-and-make-into-a-text-string-that-can/m-p/13319#M12572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works great.&amp;nbsp; thanks so much for the help on this item.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 22:55:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-get-values-from-a-table-and-make-into-a-text-string-that-can/m-p/13319#M12572</guid>
      <dc:creator>chris_dennis</dc:creator>
      <dc:date>2015-07-29T22:55:32Z</dc:date>
    </item>
  </channel>
</rss>

