SHOW SAVED QUERY
SHOW_SAVED_QUERY
shows the query text for a previously saved query.
Read more in the Saved Queries guide.
See also: SAVE QUERY, EXECUTE SAVED QUERY, DROP SAVED QUERY, LIST SAVED QUERIES.
Syntax
show_saved_query_statement ::=
SELECT SHOW_SAVED_QUERY(saved_query_name)
saved_query_name ::= string_literal
Returns
A single row result containing the saved query string.
Parameters
Parameter |
Description |
---|---|
|
The name of the query to show |
Examples
Showing a previously saved query
SELECT SAVE_QUERY('select_by_weight_and_team',$$SELECT * FROM nba WHERE Weight > ? AND Team = ?$$);
SELECT SHOW_SAVED_QUERY('select_by_weight_and_team');
saved_query
-----------------------------------------------
SELECT * FROM nba WHERE Weight > ? AND Team = ?
Permissions
Showing a saved query requires SELECT
permissions on the saved query.