Converts an expression to code that you can use in an SQL Select statement. Use Expr(...) for literal expressions. Use NameExpr(name) for expressions stored in a variable. Otherwise, the expression returns the expression to convert.
Boolean. JMP 12 Compatible is included in generated scripts when you select the Query Builder preference to create a JMP 12 compatible option or select the corresponding Query Builder red triangle menu option. The option enables JMP 12 users to run a JMP 13 query that might contain compatibility issues. Include Run on Open(1) to run the query when opened rather than opening the query in edit mode.
New SQL Query(
Connection(
"ODBC Connection String..."
),
QueryName( "g6_Movies" ),
Select( Column( "ItemNo", "t1" ), Column( "LengthMins", "t1" ), Column( "Genre", "t1" ) ),
From( Table( "g6_Movies", Schema( "SQBTest" ), Alias( "t1" ) ) )
) << Run Background( On Run Complete( dt = queryResult ) );
Show( dt );
Note that Query Builder creates a symbol called queryResult in the context of an On Run Complete() script. This is a reference to the data table imported by the query. queryResult enables you to assign a global variable to the table for later use.
Optional. Hides the resulting data table from view. The data table appears only in the JMP Home Window and the Window menu. Hidden data tables remain in memory until they are explicitly closed, reducing the amount of memory that is available to JMP. To explicitly close the hidden data table, call Close(dt), where dt is the data table reference.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
result = Query( Table( dt, "t1" ), "SELECT * FROM t1 WHERE age > 14;" );
See SQL Functions Available for JMP Queries for details about SQLite commands that Query() supports. See Writing a SQL Query in the Scripting Guide for more examples.