The SQL tab allows you to modify the SQL queries manually. The changes in this tab automatically appear in the Query Designer tab.
To switch between the tables, use the Tables list panel on the left.
This feature allows you to limit the number of records to be displayed on the List, Print, Export, Details pages. It can be useful if you need to speed up the loading of the webpage; or when your chart has too many items in it, and you need to show only the most significant ones. It also works with the List pages added to the Dashboard.
The search and filters are applied first, and then the results are limited to first "N" rows.
This option works with all PHPRunner project items except with the reports that have group fields selected.
When you connect to databases like DB2, Oracle or PostgreSQL, and your SQL query contains aliases, we recommend to enclose them in double-quotes. Here is an example:
If the field was assigned an alias in the SQL query, then the values array gets the alias instead of the field name from the database. E.g., if you have an SQL query SELECT salesrep_id AS Inv_Salesrep ..., you should use values("Inv_Salesrep").
In the example above, the alias Discount is assigned to the calculated field Price*0.1.
For more complicated queries, wrap the condition with parentheses:
If you need to use these keywords, there are two options. First is to use SQL Views. The other one is to create a view in your database using CREATE VIEW command, then use that view as a data source in PHPRunner. Check your database manual for syntax.
In MS Access views are called queries and can be created this way:
1. Run MS Access and create a new query. Switch to SQL view.
2. Insert your SQL query there.
3. Save this query as qryNewQuery.
4. Run PHPRunner and use qryNewQuery as a datasource table.
For all other SQL query types, for instance:
•Stored procedure calls;
•queries with non-standard SQL language elements such as MySQL variables
we recommend using SQL Views.