SEQUENCE-LAST
Prev | Functional Data Definition Language (FDDL) | Next

## Name

SEQUENCE-LAST — Return the last element in a database sequence.Function

## Syntax

          sequence-last name &key database => result

## Arguments and Values

`name`

  The name of the sequence as a string, symbol or SQL expression.

`database`

  A database object which defaults to *default-database*.

`result`

  An integer.

## Description

Return the last value allocated in the sequence called `name` in `database` which defaults to *default-database*.

## Examples

    (sequence-last [foo])
    => 1

## Side Effects

None.

## Affected by

The current value stored in database sequence `name`.

*default-database*

## Exceptional Situations

Will signal an error of type sql-database-data-error if a sequence called `name` does not exist in `database`.

## See Also

`create-sequence`
`drop-sequence`
`list-sequences`
`sequence-exists-p`
`sequence-next`
`set-sequence-position`

## Notes

`sequence-last` is a CLSQL extension.

Prev | Up | Next
SEQUENCE-EXISTS-P | Home | SEQUENCE-NEXT