On this page
FORMAT
Core command
Lays out the last query on several lines for readability, without changing its meaning or running it.
Syntax
FORMAT
Examples
select a.id,a.name from customer a where a.status='ACTIVE';
FORMAT;
//
Details
A rewrite, never a run
FORMAT never runs the query. On success, the formatted query becomes the last query: // and SHOW QUERY show it, and / runs it. When the query cannot be read safely (an unterminated string, quoted identifier or comment), the last query stays exactly as it was and the reason is printed.
What changes
Only the spaces and line breaks between the words of the query. The text of strings, comments (Oracle hints included), quoted identifiers, numbers and keywords is never rewritten, reordered or removed, so the meaning of the query cannot change.
Related
- EXPAND
- SHOW QUERY
- Console, the last query
Used in these how-tos
Last modified in release 5.5.0.
Found something wrong or unclear on this page? Tell us, with the page address.