<a id="ksqldb-reference-spool"></a>

# SPOOL statement in ksqlDB for Confluent Platform

## Synopsis

```sql
SPOOL <file_name|OFF>
```

## Description

Stores issued commands and their results into a file. Only one spool may
be active at a time and can be closed by issuing `SPOOL OFF` .
Commands are prefixed with `ksql>` to differentiate from output.
