cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. ET on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
UserID16644
Level V

How to query in SQL using list from JSL

Hi all, 

How can I insert a list from JSL to my SQL query?

 

Currently I am using this to get the list that I need:

 

NameList = Associative array( dtNames:"Names" ) << Get Keys; 

And will use it as a SQL query

 

dt = Open Database( "DSN=db;UID=uname;PWD=pw;APP=JMP;DATABASE=dbname;", 
"select name, age, address, sex
from  db_Details
where name in ('"||NameList||"')", // Im getting an error here
"Details" );

I am using JMP 15

2 REPLIES 2
mmarchandTSI
Level V

Re: How to query in SQL using list from JSL

I do this a lot for creating SQL queries.  Try this.

 

NameList = Substitute( Char( NameList ), "{", "", "}", "", "\!"", "'" );
txnelson
Super User

Re: How to query in SQL using list from JSL

See an additional Discussion item intitled How to skip item on JSL list in SQL query if it does not exist? 

Jim

Recommended Articles