SQL statements
- Last UpdatedAug 15, 2023
- 1 minute read
- PI System
- RtReports 5.0
- Visualization
You can provide a SQL statement directly on the Relational Datasets page by clicking inside the SQL Statement box and either typing or pasting in a statement as text. Use the Clear button to clear the SQL Statement field and fields below it on the page, discarding any changes.
When complete, click Verify SQL to validate the contents of the SQL Statement field. If the statement is invalid, an error string is returned by the data source and the Placeholders and Columns fields are cleared. If the query is successful, placeholders fields are populated if appropriate.
Import SQL
You can also click the Open Query button beneath the SQL Statement box to open the Edit Query dialog.
The Edit Query dialog box displays the contents of the SQL Statement field. You can enter or paste a SQL statement in the text input area or import SQL from a file:
-
Click Open Query to display the Edit Query dialog box.
-
Click the Browse button. A pop-up file browser dialog appears.
-
Browse to the directory containing the .txt or .sql file containing the SQL statement, and select the file.
-
Click the Open button. The selected file appears in the Import field on the Edit Query dialog box.
-
Click the Import button.
-
Click OK.
-
The imported SQL replaces the existing SQL text in the SQL Statement field.