START-SQL-RECORDING
Prev | SQL I/O Recording | Next

## Name

START-SQL-RECORDING — Start recording SQL commands or results.Function

## Syntax

          start-sql-recording &key type database =>

## Arguments and Values

`type`

  One of the following keyword symbols: :commands, :results or :both, defaulting to :commands.

`database`

  A database object. This will default to *default-database*.

## Description

Starts recording of SQL commands sent to and/or results returned from `database` which defaults to *default-database*. The SQL is output on one or more broadcast streams, initially just *standard-output*, and the functions `add-sql-stream` and `delete-sql-stream` may be used to add or delete command or result recording streams. The default value of `type` is :commands which means that SQL commands sent to `database` are recorded. If `type` is :results then SQL results returned from `database` are recorded. Both commands and results may be recorded by passing `type` value of :both.

## Examples

    (start-sql-recording :type :both)
    =>
    (select [last-name] :from [employee]
                        :where [= [emplid] 1]
                        :field-names nil
                        :flatp t)
    ;; 2004-07-02 16:42:12 dent/test/dent => SELECT last_name FROM employee WHERE (emplid = 1)
    ;; 2004-07-02 16:42:12 dent/test/dent <= (Lenin)
    => ("Lenin")

## Side Effects

The command and result recording broadcast streams associated with `database` are reinitialised with only *standard-output* as their component streams.

## Affected by

None.

## Exceptional Situations

None.

## See Also

`stop-sql-recording`
`sql-recording-p`
`sql-stream`
`add-sql-stream`
`delete-sql-stream`
`list-sql-streams`

## Notes

None.

Prev | Up | Next
SQL I/O Recording | Home | STOP-SQL-RECORDING