<?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 Updating my JMP table with SQL &amp;quot;AS&amp;quot; statement in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Updating-my-JMP-table-with-SQL-quot-AS-quot-statement/m-p/327470#M57676</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have to regularly update my JMP file by connecting to my database and running a long manually created SQL query. Until now, I used the "&lt;STRONG&gt;AS&lt;/STRONG&gt;" command to match the field names in my database with the simplified name of columns in JMP. After importing the data into a temporary JMP table, my script finished the update by making a join with my working JMP file using the same short column names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1: I tried using JMP's newest SQL query builder (available since version 11, I believe). But I can't find a button to manage the "AS" command other than to manually edit the query which considerably reduces the interest of the new constructor. Is there a more efficient way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 2: Is there a more suitable method for my needs? If I imported the fields as is (without changing the names) into the temporary table, would there be an efficient way to update the data in my JMP table? Using some sort of name mapping table in my script, for example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NB: I chose not to import the updated data directly into my JMP file because the items are not always in the same order and I regularly create new columns for derived data. Otherwise, it would create offsets when updating.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your attention&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Claude B.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:21:30 GMT</pubDate>
    <dc:creator>claude_bellavan</dc:creator>
    <dc:date>2023-06-10T23:21:30Z</dc:date>
    <item>
      <title>Updating my JMP table with SQL "AS" statement</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-my-JMP-table-with-SQL-quot-AS-quot-statement/m-p/327470#M57676</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have to regularly update my JMP file by connecting to my database and running a long manually created SQL query. Until now, I used the "&lt;STRONG&gt;AS&lt;/STRONG&gt;" command to match the field names in my database with the simplified name of columns in JMP. After importing the data into a temporary JMP table, my script finished the update by making a join with my working JMP file using the same short column names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1: I tried using JMP's newest SQL query builder (available since version 11, I believe). But I can't find a button to manage the "AS" command other than to manually edit the query which considerably reduces the interest of the new constructor. Is there a more efficient way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 2: Is there a more suitable method for my needs? If I imported the fields as is (without changing the names) into the temporary table, would there be an efficient way to update the data in my JMP table? Using some sort of name mapping table in my script, for example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NB: I chose not to import the updated data directly into my JMP file because the items are not always in the same order and I regularly create new columns for derived data. Otherwise, it would create offsets when updating.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your attention&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Claude B.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:21:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-my-JMP-table-with-SQL-quot-AS-quot-statement/m-p/327470#M57676</guid>
      <dc:creator>claude_bellavan</dc:creator>
      <dc:date>2023-06-10T23:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Updating my JMP table with SQL "AS" statement</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-my-JMP-table-with-SQL-quot-AS-quot-statement/m-p/327512#M57678</link>
      <description>&lt;P&gt;One option might be to leave the names unchanged in the query results and then update them using a saved data table having the old and new names:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

//Open a saved jmp file with the old and new names (creating the table here instead of opening it...)
dtNames = New Table( "Names",
	Add Rows( 4 ),
	New Column( "old", Character, "Nominal",
		Set Values( {"Sepal length", "Sepal width", "Petal length", "Petal width"} )
	),
	New Column( "new", Character, "Nominal",
		Set Values( {"sl", "sw", "pl", "pw"} )
	)
);

//Run database query using 'default' column names
dtQuery = Open("$Sample_data/iris.jmp");

//Update names in the query results
for each row( dtNames,
	Column( dtQuery, :old ) &amp;lt;&amp;lt; Set Name( :new )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Oct 2020 17:26:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-my-JMP-table-with-SQL-quot-AS-quot-statement/m-p/327512#M57678</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-10-28T17:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Updating my JMP table with SQL "AS" statement</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-my-JMP-table-with-SQL-quot-AS-quot-statement/m-p/328199#M57751</link>
      <description>&lt;P&gt;Thank you very much ih.&lt;/P&gt;&lt;P&gt;That will be very useful!&lt;/P&gt;&lt;P&gt;Claude B.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 14:06:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-my-JMP-table-with-SQL-quot-AS-quot-statement/m-p/328199#M57751</guid>
      <dc:creator>claude_bellavan</dc:creator>
      <dc:date>2020-10-30T14:06:40Z</dc:date>
    </item>
  </channel>
</rss>

