EXECUTE-COMMAND — Execute an SQL command which returns no values.
Function
An sql expression that represents an SQL statement which will return no values.
A database object. This will default to the value of *default-database*.
This will execute the command given by sql-expression in the database specified. If the execution succeeds it will return t, otherwise an error of type clsql-sql-error will be signalled.
(execute-command "create table eventlog (time char(30),event char(70))")
=> T
(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 'CLSQL-SQL-ERROR :DATABASE DATABASE :EXPRESSION ...)
>> 0] 0
(execute-command "drop table eventlog")
=> T
Whatever effects the execution of the SQL statement has on the underlying database, if any.