cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Jackie_
Level VI

Get values in the list from SQL query

Hi,

 

Is there way I could insert the column values in the list than jmp table?

Jackie__0-1684435041614.png

I 'm trying to write a JSL code to query data from database and I want to store the values from the SQL table into a variable list (not in the JMP table).
For example, save the WorkCenter sql table values in the list= {};
Any suggestions?

Thanks,

Jackie

4 REPLIES 4
txnelson
Super User

Re: Get values in the list from SQL query

The simplest thing to do, would be to extract the column of data into a JMP data table(it can be an invisible table if desired) and then to use

ValueList = :column name << get values;

to move the column of data from the data table to a list, and then simply close the data table.

 

Jim
Jackie_
Level VI

Re: Get values in the list from SQL query

Hi Jim, That's what I am doing rn, but the problem is it will keep generating multiple tables every time the query is run.
Thanks!

txnelson
Super User

Re: Get values in the list from SQL query

Your JSL should be able to delete all of those data tables very quickly, so they will not create any issues for the user.

Jim
jthi
Super User

Re: Get values in the list from SQL query

1. Perform the query and get table as invisible/private

2. Get values from the table

3. Close the table

(4. Write a function to do all this if you repeat it many times with different queries)

-Jarmo