Home arrow Reference arrow Query, Run, ODBC / Oracle / SQL / JDBC
Query, Run, ODBC / Oracle / SQL / JDBC
This function executes the query that has been specified through the other Query functions. The result is a new page.

Syntax:

Query, Run, queryType, connectionString

Parameters:

queryType – the type of query { odbc, oracle, sql, jdbc }

connectionString – the connection string for the query

Examples:

Query,Command,"select order,product,category,2006,2007,forecast"

Query,CommandAppend,"from sales_history"

Query,Roles,order=RowLabel_;product=Text_;category=Text_; 2006=Numeric_;2007=Numeric_;forecast=Ignore_

Query,RowLabel,Orders

Query,Captions,2006 Sales;2007 Sales

Query,TextColumnNames,Product Line;Product Category

Query,Run,SQL,"Server=DBserver;Database=dbname; Trusted_Connection=yes"

 

This example runs the query using the connection string provided. The entire Query sequence is included for clarity.

Query,Command,"select order as RowLabel_Orders,product as [text_Product Line],category as [text_Product Category],2006 as [numeric_2006 Sales],2007 as [numeric_2007 Sales],forecast as Ignore_Forecast "

Query,CommandAppend," from sales_history"

Query,Run,SQL,"Server=DBserver;Database=dbname; Trusted_Connection=yes"

This example is identical to above, but uses the field names in the query to set the roles and captions. Square brackets are used in the query to encapsulate the spaces in the field names, so care should be taken to ensure that NextAnalytics prompts are not created with the same character sequences.

Comments:

These Query commands are usually grouped together into a file in the user’s pages directory and called from an AddQueryPage command.

 

Reference

Installation - Java