cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

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

how to apply variable to custom SQL

in custom SQL, this works. 

.....left join  c
on d.SCU = c.CU
where d.DE in (' 216532','216534')

in script, I define a variable: inString = ' 216532','216534'

then I like to run custom SQL:

.....left join  c
on d.SCU = c.CU
where d.DE in (' inString')

but i doesn't work. how do I use my variable in custom SQL correctly?

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: how to apply variable to custom SQL

You can use Eval Insert() 

inString = "'216532','216534'";

sql_template = "\[
	.....left join  c
on d.SCU = c.CU
where d.DE in (^inString^)
]\";

sql_str = Eval Insert(sql_template);
-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: how to apply variable to custom SQL

You can use Eval Insert() 

inString = "'216532','216534'";

sql_template = "\[
	.....left join  c
on d.SCU = c.CU
where d.DE in (^inString^)
]\";

sql_str = Eval Insert(sql_template);
-Jarmo

Recommended Articles