Subscribe Bookmark RSS Feed

JMP application pass variables

DNAFoundry

Occasional Contributor

Joined:

Mar 17, 2017

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!

 

 

3 REPLIES
thickey1

Community Trekker

Joined:

Jun 4, 2015

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.
DNAFoundry

Occasional Contributor

Joined:

Mar 17, 2017

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

Staff

Joined:

May 30, 2014

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)||"'"