On this page

SHOW QUERY

Core command SH QU SHQU

Shows the last SQL query of the session, the one that / runs again.

Syntax

SHOW QUERY

Examples

SELECT * FROM CUSTOMER WHERE COUNTRY = 'FR';
SHOW QUERY;
//

Example session

WORLD-QA> SELECT COUNT(*) AS CITIES FROM CITY WHERE COUNTRYCODE = 'FRA';
|--------------------|
|CITIES              |
|--------------------|
|41                  |
|--------------------|

1 rows fetched in 5 ms.

WORLD-QA> / PROD
Running last query on WORLD [PROD]...
|--------------------|
|CITIES              |
|--------------------|
|40                  |
|--------------------|

1 rows fetched in 0 ms.

WORLD-QA>
Illustrative output: the values come from the WORLD sample and the practice connections of the how-to on QA and production copies of WORLD, and the layout from this release; it was not captured from a BroadSQL run, and your timings will differ.

Details

The query is printed on a single line, convenient for reading and copying even when it was typed or pasted over several lines. When no query has run yet, the command prints No query in memory.

It is the statement that / runs again, and that / <environment> runs once against another Environment of the current Database Group. // is a shortcut for SHOW QUERY.

Used in these how-tos

Last modified in release 5.5.0.

Found something wrong or unclear on this page? , with the page address.