Hello! I am new to JMP/JSL scripting and am having some trouble figuring things out. I feel like what I am trying to do should be very simple but nothing seems to be working as I would expect and google is failing me.
What I am trying to do: I have a simple stored procedure that just returns a control limit value from our SQL database based on a few parameters I pass to it. I am then trying to assign that value to a Levey Jennings control limit for a column. The code below is as far as I have gotten.
This code is outputting a table with my desired value.
// Get limit value
LimitType = "Control";
LimitLevel = "Lower";
utagID = "6720";
vLCL = open database(
"Driver={SQL Server};Server=FC-SQL-P\PROD;Database=ctc_config;Trusted_Connection=yes",
"cus_sp_taglimits
@LimitType = " || LimitType || ",
@LimitLevel = " || LimitLevel || ",
@utagid = '" || utagID || "'"
);
I am then trying to use the value of "vLCL" and apply it to a different tables column properties.
// Change column property
Data Table( "testTable" ):testColumn << Set Property(
"Control Limits",
{Levey Jennings( LCL( vLCL ) )}
);
The script above works fine when I replace "vLCL" with a number.
Where I think I am getting stuck is, how do I use my SQL result as an actual variable? Is there a way to query a value directly into a variable instead of pulling it into a new table?
Any help on this would be greatly appreciated! Thank you in advance!!
-Jane