EXECUTE-COMMAND
Prev | Functional Data Manipulation Language (FDML) | Next

## Name

EXECUTE-COMMAND — Execute an SQL command which returns no values.Generic Function

## Syntax

          execute-command sql-expression &key database =>

## Arguments and Values

`sql-expression`

  An sql expression that represents an SQL statement which will return no values.

`database`

  A database object. This will default to the value of *default-database*.

## Description

Executes the SQL command `sql-expression`, which may be a symbolic SQL expression or a string representing any SQL statement apart from a query, on the supplied `database` which defaults to *default-database*.

## Examples

            (execute-command "create table eventlog (time char(30),event char(70))")
            =>

            (execute-command "create table eventlog (time char(30),event char(70))")
            >>
            >> While accessing database #<CLSQL-POSTGRESQL:POSTGRESQL-DATABASE {480B2B6D}>
            >>   with expression "create table eventlog (time char(30),event char(70))":
            >>   Error NIL: ERROR:  amcreate: eventlog relation already exists
            >>   has occurred.
            >>
            >> Restarts:
            >>   0: [ABORT] Return to Top-Level.
            >>
            >> Debug  (type H for help)
            >>
            >> (CLSQL-POSTGRESQL::|(PCL::FAST-METHOD DATABASE-EXECUTE-COMMAND (T POSTGRESQL-DATABASE))|
            >>  #<unused-arg>
            >>  #<unused-arg>
            >>  #<unavailable-arg>
            >>  #<unavailable-arg>)
            >> Source: (ERROR 'SQL-DATABASE-ERROR :DATABASE DATABASE :EXPRESSION ...)
            >> 0] 0

            (execute-command "drop table eventlog")
            =>

## Side Effects

Whatever effects the execution of the SQL statement has on the underlying database, if any.

## Affected by

None.

## Exceptional Situations

If the execution of the SQL statement leads to any errors, an error of type sql-database-error is signalled.

## See Also

`query`

## Notes

None.

Prev | Up | Next
DELETE-RECORDS | Home | QUERY