ADD-SQL-STREAM
Prev | SQL I/O Recording | Next

## Name

ADD-SQL-STREAM — Add a component to the broadcast streams used for recording SQL commands or results.Function

## Syntax

          add-sql-stream stream &key type database => result

## Arguments and Values

`stream`

  A stream or `T`.

`type`

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

`database`

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

`result`

  The added stream.

## Description

Adds the supplied stream `stream` (or `T` for *standard-output*) as a component of the recording broadcast stream for the SQL recording type specified by `type` on `database` which defaults to *default-database*. `type` must be one of :commands, :results, or :both, defaulting to :commands, depending on whether the stream is to be added for recording SQL commands, results or both.

## Examples

    (start-sql-recording :type :commands)
    =>
    (with-output-to-string (s)
      (add-sql-stream s :type :commands)
      (print-query [select [emplid] [first-name] [last-name] [email] :from [employee]]
                   :stream s))

    ;; 2004-07-02 17:38:45 dent/test/dent => SELECT emplid,first_name,last_name,email FROM employee
    =>
    ";; 2004-07-02 17:38:45 dent/test/dent => SELECT emplid,first_name,last_name,email FROM employee
    1  Vladimir   Lenin     lenin@soviet.org
    2  Josef      Stalin    stalin@soviet.org
    3  Leon       Trotsky   trotsky@soviet.org
    4  Nikita     Kruschev  kruschev@soviet.org
    5  Leonid     Brezhnev  brezhnev@soviet.org
    6  Yuri       Andropov  andropov@soviet.org
    7  Konstantin Chernenko chernenko@soviet.org
    8  Mikhail    Gorbachev gorbachev@soviet.org
    9  Boris      Yeltsin   yeltsin@soviet.org
    10 Vladimir   Putin     putin@soviet.org     "

## Side Effects

The specified broadcast stream(s) associated with `database` are modified.

## Affected by

None.

## Exceptional Situations

None.

## See Also

`start-sql-recording`
`sql-stream`
`delete-sql-stream`
`list-sql-streams`

## Notes

None.

Prev | Up | Next
SQL-STREAM | Home | DELETE-SQL-STREAM