cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
vharibal
Level II

How to save a jmp data table after its downloaded from sql query

I am importing data from data base and would like to save the data table. The data table takes some time to get downloaded. I would like to detect when the datable is downloaded and then save it at a location. Below is the code i tried.

 

The first part of extracting data table is happening fine.

The second part (highlighted in blue ) of detecting the data table once its downloaded and open is not working. I a, using 

"get data table list" and printing that value once data table is downloaded.

 

// Extracting data table from data base //
ex1 = New Window( "TRIAL_1", << modal,
panel Box( "NAME", 
H List Box( 
Text Box( "batchid:" ), 
teb0 = Number Edit Box()
);
 
),
panel box("SELECT",

h list box(
ok_button = button box("OK", 
(
a = teb0 << get;
obj = New SQL Query(
Connection( "ODBC:DSN=SLT Data Server" ),
QueryName( "t_wlan_mfg_data" ),
CustomSQL(
Eval Insert("SELECT *
FROM t_wlan_mfg_data  t1  where( t1.batchid = ^a^ );")
)
) << Run;

)
),

),

);
);

// Waiting for data table to save //

i=1;
while (
i,

(l = get data table list();
show(l);


if (
Nitems(l)>0;
show(l);
break();
);

"no";
);

i++,

);


1 REPLY 1
jthi
Super User

Re: How to save a jmp data table after its downloaded from sql query

If you don't mind JMP to wait for the query to finish you can use << Run Foreground instead of <<run (you should in my opinion always use either << Run Background or << Run Foreground instead of <<Run) and then save the data table when JMP continues the script execution. Other option is to use << On Run Complete (scripting index has simple example), and save the table with that( SQL Messages (jmp.com) ).

-Jarmo