On this page
COPY RESULT
Copies the last result, of a SQL query or a RUN, to the clipboard, ready to paste into a spreadsheet.
Syntax
COPY RESULT
Examples
SELECT * FROM CUSTOMER;
COPY RESULT;
RUN /api/customer/123;
COPY RESULT;
Details
Which result
The source is whichever ran last in the session: the last SQL query (the one / runs again) or the last RUN of an API endpoint. When neither has run yet, the command prints No query in memory.
- A SQL query is run again to copy its result, since BroadSQL does not keep a result after the query ends. Its
${name}variables take their current values. - An API result is copied as
DUMP API RESULTwould export it.
Clipboard content
The text is the same table that DUMP ... AS TEXT writes to a file: tab separated, a NULL as an empty field, the same value formatting, and a value containing a tab, a quote or a line break in double quotes, so that pasting never shifts the columns. The clipboard is retried when another application briefly locks it; a session without a graphical desktop gets a clear error.
Related
- DUMP, to write the result to a file
- RUN
- Exporting results
Used in these how-tos
- How do I check a colleague's spreadsheet list against the database?
- How do I build a weekly Excel report with one tab per query and a tab that grows?
- How do I investigate a support ticket and keep the evidence?
Last modified in release 5.5.0.
Found something wrong or unclear on this page? Tell us, with the page address.