CAPTURE
Captures CQL query output and appends the output to a specified file. Error messages and cqlsh commands are displayed in the standard terminal output. All other cqlsh output is appended to the file. To display the current capture status, enter CAPTURE with no options.
Synopsis
CAPTURE [ '<file_name>' | OFF ]
Syntax legend
Syntax conventions | Description |
---|---|
UPPERCASE |
Literal keyword. |
Lowercase |
Not literal. |
|
Variable value. Replace with a user-defined value. |
|
Optional.
Square brackets ( |
|
Group.
Parentheses ( |
|
Or.
A vertical bar ( |
|
Repeatable.
An ellipsis ( |
|
Single quotation ( |
|
Map collection.
Braces ( |
Set, list, map, or tuple.
Angle brackets ( |
|
|
End CQL statement.
A semicolon ( |
|
Separate the command line options from the command arguments with two hyphens ( |
|
Search CQL only: Single quotation marks ( |
|
Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrConfig files. |
- <file_name>
-
The file to write the query output to. When you run the first query after starting the capture, the file is created if it does not already exist. Use a relative path from the current working directory or specify tilde (~) for your home directory. Absolute paths are not supported.
- OFF
-
Stops capture.
Examples
Capture results to the winners text file:
CAPTURE '~/results/winners.txt'
The results directory must exist in your home directory. The winners text file is created if it does not exist. |
Now capturing query output to '/Users/<local_system_user>/results/winners.txt'.
Execute a query that selects all cycling race winners:
SELECT *
FROM cycling.race_winners;
Results are appended to the end of the capture file. The results are not displayed in the terminal.