BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
Highlighted
DNAFoundry
Community Trekker

JMP application pass variables

Hi,

 

I am trying to take a variable from a text box (variable name JOB_ID)  in applicaiton builder and use it as part of a concatonated string.

 

I have the code below as the press code in a button

 

SQL_Statement ="SELECT * FROM SAS_Plate_Reader  t1 Where Job_ID='"||Job_ID||"'";

New SQL Query(
	Connection(
		"ODBC:DSN=SQLite3 Datasource;Database=Z:\Projects\Project1014\Amos\J000g\SAS\SAS_Data.db;StepAPI=0;SyncPragma=NORMAL;NoTXN=0;Timeout=100000;ShortNames=0;LongNames=0;NoCreat=0;NoWCHAR=0;FKSupport=0;JournalMode=;OEMCP=0;LoadExt=;BigInt=0;JDConv=0;"
	),
	QueryName( "SAS_Plate_Reader" ),
	CustomSQL( SQL_statement )
) << Run;

The error message i get is:

rgument should be character in access or evaluation of 'Concat' , Bad Argument( Job_ID ), "SELECT * FROM SAS_Plate_Reader  t1 Where Job_ID='" ||  /*###*/Job_ID ||  /*###*/"'" /*###*/

 

I think I dont understand the name space to pass the textbox to the script or how to concatenate a string properly, so any help appreciated!

 

 

0 Kudos
3 REPLIES 3
thickey1
Community Trekker

Re: JMP application pass variables

Try this

SQL_Statement ="SELECT * FROM SAS_Plate_Reader  t1 Where Job_ID='"||char(Job_ID)||"'";

I'm guessing your Job_ID os a numeric type and you are trying to concat this to a string. Need to cast to a string with teh char() fn.
0 Kudos
DNAFoundry
Community Trekker

Re: JMP application pass variables

I don't think it can be as it is a text edit box.
0 Kudos

Re: JMP application pass variables

It looks Job_ID is a variable that holds a texteditbox. What you need is the string that the texteditbox has in it. You can do that with the message Get Text.

 

In your code, try this (change in red):

SQL_Statement ="SELECT * FROM SAS_Plate_Reader  t1 Where Job_ID='"||(Job_ID<<Get Text)||"'"