<?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: Help consolidating jmp queries and scripts. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270072#M52564</link>
    <description>&lt;P&gt;The error is because you're trying to set the column header using single quotes.&amp;nbsp; Oracle wants the column name to be enclosed in double quotes.&amp;nbsp; This should work - note that I'm using \[ and ]\ to allow double quotes to be in the string without those pesky escape characters.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;M32FICDSQL =
"\[SELECT t1.LOTID, t2.COMPIDS AS WAFERID, t1.EQPID, t2.REVDATE AS "M32-FICD-DATE", 
	t1.PARTID, t1.RECPID, t2.ITEMPROMPT, t2.NUMERICVALUE, 
	t3.LOTTYPE 
FROM PLLDBA.TRES  t1 
	LEFT OUTER JOIN PLLDBA.ACTL t3 
		ON  ( t1.LOTID = t3.LOTID )  
	INNER JOIN PLLDBA.TRES_RAWDATA t2 
		ON  (  ( t1.TESTOPNO = t2.TESTOPNO )  AND  ( t1.REVDATE = t2.REVDATE )  )  
WHERE  (  (  (  (t1.TESTOPNO LIKE  '%JG43%' )  )  AND  ( t2.REVDATE &amp;gt;= TO_TIMESTAMP('01Jan2019:18:42:42', 'DDMONYYYY:HH24:MI:SS') )  AND  ( t2.ITEMPROMPT IN  ( 'ITEM1' ,  'MITEM2' ,  'ITEM3' ,  'ITEM4' )  )  AND  (  (t1.RECPID LIKE  '%HJ546%' )  )  AND  (  (t3.LOTTYPE LIKE  '%PT%' )  )  AND  (  (t1.PARTID LIKE  '%C765G%' )  )  )  ) 
ORDER BY t2.COMPIDS DESC, t2.REVDATE ASC;]\";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you keep having trouble don't use the AS command and instead change the column name in JSL.&amp;nbsp; You shouldn't have to - I use this syntax all the time with no problems.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jun 2020 19:03:46 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2020-06-01T19:03:46Z</dc:date>
    <item>
      <title>Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269446#M52458</link>
      <description>&lt;P&gt;I started using jmp recently&amp;nbsp; for importing manufacturing data directly to jmp tables and analysing them.&lt;/P&gt;&lt;P&gt;Typically my requirement is to extract the data&amp;nbsp; for each process step in the manufacturing process, for all the batches processed and making charts from them.&lt;/P&gt;&lt;P&gt;So I started with making jmpqueires for each of the processes - and often I want to give the process code as well as the date from which i want the extraction as inputs to the query.&lt;/P&gt;&lt;P&gt;All my jmpqueries therefore has following filters , and I have kept the date as a prompt variable so that I can change it every time I run the query&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="spoikayil_1-1590690900757.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24224i7CD64DCE531511FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="spoikayil_1-1590690900757.png" alt="spoikayil_1-1590690900757.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have some post processing script as almost always the data is not stored in the format and shape as I want it to plot charts. This forces me to create a new table from the table that comes out with the original query's extraction.&lt;/P&gt;&lt;P&gt;So, all my jmpqueries end up generating two tables an example is shown below;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="spoikayil_2-1590691117176.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24225i9AAF207FC614ABAC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="spoikayil_2-1590691117176.png" alt="spoikayil_2-1590691117176.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was working pretty good, until now, I want to start consolidating these queries by joining different tables generated by my many different jmp queries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I start writing the below script which goes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;finCDquery = open( "PATH\New M33 final CD.jmpquery", Private );
devCDquery = open( "PATH\New M33 develop CD.jmpquery", Private );

M33finCD = finCDquery &amp;lt;&amp;lt; Run Foreground(Private);
M33devCD = devCDquery &amp;lt;&amp;lt; Run Foreground(Private);

Data Table( "M33-CD QUERY" ) &amp;lt;&amp;lt; Join(
	With( Data Table( "M33D-CD QUERY" ) ),
	Select(.
.
.
.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now, here are the things I would like to have some help with; because I am not quite getting the expected response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;First, every query has the date prompt so I need to wait and give the date and click ok several times in between - how can I modify the queries such that the first date i give is taken and used for all subsequent jmp queries?&lt;/LI&gt;&lt;LI&gt;Although I am opening the tables I dont want to be visible as Private, they keep showing up nevertheless. What am I doing wrong?&lt;/LI&gt;&lt;LI&gt;I have the SQL queries for all my jmpqueies, how can I put them in the script rather than opening each of my jmpquery files as I am doing now?&lt;/LI&gt;&lt;/OL&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:27:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269446#M52458</guid>
      <dc:creator>spoikayil</dc:creator>
      <dc:date>2023-06-09T23:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269561#M52486</link>
      <description>&lt;P&gt;If you have the SQL queries, you could switch over to using execute SQL.&amp;nbsp; Here's how to execute two queries using the same date range.&amp;nbsp; Note that the TO_DATE function is Oracle syntax.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dbc = create database connection("&amp;lt;connection string&amp;gt;");

start_date = "01-Jan-2020";
end_date   = "30-Apr-2020";
sql1 = evalinsert(
"SELECT m.foo, m.bar
   FROM myschema.mytable m
  WHERE m.some_date BETWEEN TO_DATE('^start_date^', 'DD-MON-YYYY')
                        AND TO_DATE('^end_date^', 'DD-MON-YYYY')");

dt1 = execute sql(dbc, sql1);

sql2 = evalinsert(
"SELECT a.field1, a.field2 
   FROM myschema.another_table a 
  WHERE a.some_date BETWEEN TO_DATE('^start_date^', 'DD-MON-YYYY')
                        AND TO_DATE('^end_date^', 'DD-MON-YYYY')");

dt2 = execute sql(dbc, sql2);

close database connection(dbc);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 May 2020 12:31:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269561#M52486</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-05-29T12:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269591#M52490</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp; for your feedback, I&amp;nbsp; tried this. I copied the connection string in my jmpquery, but the script doesnt run, and the log gives the following error:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P class="1590761451945"&gt;[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified\&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However the same connection works fine when I run the jmpqueries. What might be off here?&lt;/P&gt;&lt;P&gt;My connection string:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;MYDB = create database connection("ODBC:DSN=*****;UID=*****;PWD=*****;DBQ=*****;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=F;FWC=F;FBS=64000;TLO=O;MLD=0;ODA=F;STE=F;TSZ=8192;AST=FLOAT;");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 May 2020 14:12:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269591#M52490</guid>
      <dc:creator>spoikayil</dc:creator>
      <dc:date>2020-05-29T14:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269592#M52491</link>
      <description>P.S: I am using 32 bit JMP14.1.0 and my Oracle driver is also 32 bit</description>
      <pubDate>Fri, 29 May 2020 14:20:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269592#M52491</guid>
      <dc:creator>spoikayil</dc:creator>
      <dc:date>2020-05-29T14:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269606#M52493</link>
      <description>&lt;P&gt;I've had trouble with the Microsoft Oracle ODBC driver.&amp;nbsp; The one from Oracle works fine though.&lt;/P&gt;
&lt;P&gt;It's a bit tedious, but here's how I got the connection string:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In JMP, click on &lt;STRONG&gt;Preferences &amp;gt; Tables&lt;/STRONG&gt;.&amp;nbsp; Make sure &lt;STRONG&gt;ODBC Hide Connection String&lt;/STRONG&gt; is unchecked.&lt;/LI&gt;
&lt;LI&gt;Click on &lt;STRONG&gt;File &amp;gt; Database &amp;gt; Open Table&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Click on &lt;STRONG&gt;New Connection&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;If you don't see an Oracle ODBC driver listed under Machine Data Source click &lt;STRONG&gt;New&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Select the appropriate Oracle driver.&amp;nbsp; On my machine it is "&lt;STRONG&gt;Oracle in OraClient 12Home1&lt;/STRONG&gt;"&lt;/LI&gt;
&lt;LI&gt;Click &lt;STRONG&gt;Finish&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;You'll come to an Oracle ODBC Driver Configuration screen&lt;/LI&gt;
&lt;LI&gt;Select the appropriate TNS service name and user ID.&lt;/LI&gt;
&lt;LI&gt;Click Test Connection to try the connection out&lt;/LI&gt;
&lt;LI&gt;Click OK, OK&lt;/LI&gt;
&lt;LI&gt;The Database Open Table screen will show a list of schemas&lt;/LI&gt;
&lt;LI&gt;Click on a schema and tables will appear.&lt;/LI&gt;
&lt;LI&gt;Click on a table and then click on &lt;STRONG&gt;Open Table&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;The table will have a program called &lt;STRONG&gt;Source&lt;/STRONG&gt;.&amp;nbsp; Right click on the green triangle and select &lt;STRONG&gt;Edit&lt;/STRONG&gt; - that will show you the correct connection string.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Like I said tedious but once you have the connection string you're good to go.&amp;nbsp; Don't forget to check the ODBC Hide checkbox in preferences.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 15:56:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269606#M52493</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-05-29T15:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269769#M52511</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/15798"&gt;@spoikayil&lt;/a&gt;&amp;nbsp;, Please note that there are several Methods for querying data from databases, needing somehow different Connections.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the .jmpquery the Connection String Needs to start with "ODBC: …", and for the others you Need to delete it, see jsl example. Otherwise you get exactly the error you posted. It took me some time to figure it out in the past.&lt;/P&gt;&lt;P&gt;The example generates 3 tables using different Methods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Three methods to get data from database via ODBC

Names Default To Here( 1 );

// provide your credentials here (DSN, USER, PWD, DBQ)
cnx_str1 = "ODBC:DSN=__MY_DSN__;UID=__USER__;PWD=__PWD__;DBQ=__MY_DBQ__;";
cnx_str2 = "DSN=__MY_DSN__;UID=__USER__;PWD=__PWD__;DBQ=__MY_DBQ__;";

sql_str = "select * from dual";

//**** 1st method
dt1 = New SQL Query( connection( cnx_str1 ), queryname( "dt_jmpquery" ), customSQL( sql_str ) ) &amp;lt;&amp;lt; Run Foreground();

//**** 2nd method
// This fails due to cnx starting with "ODBC:"
// dt2 = open database(cnx_str1, "select * from dual");
// This is ok
dt2 = Open Database( cnx_str2, sql_str, "dt_open_database" );

//**** 3rd method
cnx = Create Database Connection( cnx_str2 );
dt2 = Execute SQL( cnx, sql_str, "dt_execute_SQL" );
Close Database Connection( cnx );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 May 2020 22:21:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269769#M52511</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-05-29T22:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269863#M52529</link>
      <description>&lt;P&gt;To add to what&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/9474"&gt;@Georg&lt;/a&gt;&amp;nbsp;said, my Oracle connection string looks like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dsn_string = "Driver={Oracle in OraClient12Home1};Dbq=tns_alias_goes_here;UID=username_goes_here;PWD=password_goes_here;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that the part that says "Oracle in OraClient12Home1" is the name of the Oracle ODBC driver.&lt;/P&gt;</description>
      <pubDate>Sun, 31 May 2020 00:18:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/269863#M52529</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-05-31T00:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270050#M52558</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/9474"&gt;@Georg&lt;/a&gt;&amp;nbsp; thanks very much for your feedback!&lt;/P&gt;&lt;P&gt;I verified the preferences were as suggested by pmroz, and then tried method 1, that Georg had recommended - assignig the connection string and SQL&amp;nbsp; query to separate variables and runnig the query with the New&amp;nbsp; SQL Query() method.&lt;/P&gt;&lt;P&gt;It seems to work - as I no longer get the ODBC driver error I used to get before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I get a new error like below; and I am not sure if that is due to a bad query or not.&lt;/P&gt;&lt;P&gt;I have copied the query from the jmpquery file's SQL tab. I changed the double quotes for the column alias&amp;nbsp;&lt;CODE class=" language-jsl"&gt;'M32-FICD-DATE'&lt;/CODE&gt; for the REVDATE column to single quotes, as otherwise it catches the wrong double quote as the end of the string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;[Oracle][ODBC][Ora]ORA-00923: FROM keyword not found where expected [SQLSTATE=HY000] in access or evaluation of 'Run Foreground' , Run Foreground() /*###*/

In the following script, error marked by /*###*/
Names Default To Here( 1 );
cnxstrng =
"ODBC:DSN=****;UID=*******;PWD=******;DBQ=*****;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=F;FWC=F;FBS=64000;TLO=O;MLD=0;ODA=F;STE=F;TSZ=8192;AST=FLOAT;";
M32FICDSQL =
"SELECT t1.LOTID, t2.COMPIDS AS WAFERID, t1.EQPID, t2.REVDATE AS 'M32-FICD-DATE', 
	t1.PARTID, t1.RECPID, t2.ITEMPROMPT, t2.NUMERICVALUE, 
	t3.LOTTYPE 
FROM PLLDBA.TRES  t1 
	LEFT OUTER JOIN PLLDBA.ACTL t3 
		ON  ( t1.LOTID = t3.LOTID )  
	INNER JOIN PLLDBA.TRES_RAWDATA t2 
		ON  (  ( t1.TESTOPNO = t2.TESTOPNO )  AND  ( t1.REVDATE = t2.REVDATE )  )  
WHERE  (  (  (  (t1.TESTOPNO LIKE  '%JG43%' )  )  AND  ( t2.REVDATE &amp;gt;= TO_TIMESTAMP('01Jan2019:18:42:42', 'DDMONYYYY:HH24:MI:SS') )  AND  ( t2.ITEMPROMPT IN  ( 'ITEM1' ,  'MITEM2' ,  'ITEM3' ,  'ITEM4' )  )  AND  (  (t1.RECPID LIKE  '%HJ546%' )  )  AND  (  (t3.LOTTYPE LIKE  '%PT%' )  )  AND  (  (t1.PARTID LIKE  '%C765G%' )  )  )  ) 
ORDER BY t2.COMPIDS DESC, t2.REVDATE ASC;";
dt1 = New SQL Query(
	connection( cnxstrng ),
	queryname( "M32FICD" ),
	customSQL( M32FICDSQL )
) &amp;lt;&amp;lt; Run Foreground() /*###*/;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jun 2020 19:03:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270050#M52558</guid>
      <dc:creator>spoikayil</dc:creator>
      <dc:date>2020-06-01T19:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270070#M52563</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/15798"&gt;@spoikayil&lt;/a&gt;&amp;nbsp;, you´re on the Right way, the Connection seems to be ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your error is an SQL error, the ODBC Driver tells you that there is an error before your "from" Statement in the SQL. So I think, there is a Problem with "-" in your column Name 'M32-FICD-DATE', even when quoted. You get the same error, when missing a colon (,) in the select Statement. Never use "-" in Names, and never use double quotes (as you mentioned already).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Writing/developing SQL Queries in JMP (Scripting error) is very difficult, because you easily make Syntax Errors like here. And there are a lot more issues with SQL in scripts, some of them you even can't see (some hidden characters …). Although I'm an experienced SQL writer meanwhile, I Always use a different tool like SQL developer .. for writing SQL. With JMP it is not possible to write plain SQL&amp;nbsp;in my opinion, at least for complex queries. But of Course you can use the graphical query builder for simple queries.&lt;/P&gt;&lt;P&gt;Slightly better it looks, when you Substitute "Run Foreground()" by "Modify()", then you get the query Editor opened, and you can better Read your query, and also test it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 18:58:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270070#M52563</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-06-01T18:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270072#M52564</link>
      <description>&lt;P&gt;The error is because you're trying to set the column header using single quotes.&amp;nbsp; Oracle wants the column name to be enclosed in double quotes.&amp;nbsp; This should work - note that I'm using \[ and ]\ to allow double quotes to be in the string without those pesky escape characters.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;M32FICDSQL =
"\[SELECT t1.LOTID, t2.COMPIDS AS WAFERID, t1.EQPID, t2.REVDATE AS "M32-FICD-DATE", 
	t1.PARTID, t1.RECPID, t2.ITEMPROMPT, t2.NUMERICVALUE, 
	t3.LOTTYPE 
FROM PLLDBA.TRES  t1 
	LEFT OUTER JOIN PLLDBA.ACTL t3 
		ON  ( t1.LOTID = t3.LOTID )  
	INNER JOIN PLLDBA.TRES_RAWDATA t2 
		ON  (  ( t1.TESTOPNO = t2.TESTOPNO )  AND  ( t1.REVDATE = t2.REVDATE )  )  
WHERE  (  (  (  (t1.TESTOPNO LIKE  '%JG43%' )  )  AND  ( t2.REVDATE &amp;gt;= TO_TIMESTAMP('01Jan2019:18:42:42', 'DDMONYYYY:HH24:MI:SS') )  AND  ( t2.ITEMPROMPT IN  ( 'ITEM1' ,  'MITEM2' ,  'ITEM3' ,  'ITEM4' )  )  AND  (  (t1.RECPID LIKE  '%HJ546%' )  )  AND  (  (t3.LOTTYPE LIKE  '%PT%' )  )  AND  (  (t1.PARTID LIKE  '%C765G%' )  )  )  ) 
ORDER BY t2.COMPIDS DESC, t2.REVDATE ASC;]\";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you keep having trouble don't use the AS command and instead change the column name in JSL.&amp;nbsp; You shouldn't have to - I use this syntax all the time with no problems.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 19:03:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270072#M52564</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-06-01T19:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270074#M52565</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp; thanks for your Suggestion using&amp;nbsp;general Quotation \[ \], this is another way I even didn't think of.&lt;/P&gt;&lt;P&gt;Unless it might work that way, I personally don't like Hyphens in names and double quotes in SQL …, because I had a lot of pain due to that … in past.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 19:35:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270074#M52565</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-06-01T19:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270076#M52566</link>
      <description>&lt;P&gt;It's difficult to develop SQL in JSL - as&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/9474"&gt;@Georg&lt;/a&gt;&amp;nbsp;mentions use a tool like SQL Developer or PL/SQL Developer.&lt;/P&gt;
&lt;P&gt;I developed the &lt;STRONG&gt;log_execute_sql&lt;/STRONG&gt; function a few years ago - it's posted in the file exchange:&amp;nbsp;&lt;LI-MESSAGE title="Error trapping for Oracle ODBC SQL" uid="22622" url="https://community.jmp.com/t5/JMP-Scripts/Error-trapping-for-Oracle-ODBC-SQL/m-p/22622#U22622" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's become an invaluable aid for us to debug SQL in JSL.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 11:52:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270076#M52566</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-06-02T11:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help consolidating jmp queries and scripts.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270077#M52567</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/9474"&gt;@Georg&lt;/a&gt;&amp;nbsp; Thanks guys!!&lt;BR /&gt;Enclosing the query in&amp;nbsp;\[ does the trick for the second issue.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 19:45:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-consolidating-jmp-queries-and-scripts/m-p/270077#M52567</guid>
      <dc:creator>spoikayil</dc:creator>
      <dc:date>2020-06-01T19:45:12Z</dc:date>
    </item>
  </channel>
</rss>

