- (symbol (gethash (symbol-name-default-case (symbol-name operation))
- *sql-op-table*))))
-
-(defun sql-operation (operation &rest rest)
- "Generates an SQL statement from an operator and arguments."
- (if (sql-operator operation)
- (apply (symbol-function (sql-operator operation)) rest)
- (error "~A is not a recognized SQL operator." operation)))
+ (symbol (values (gethash (symbol-name-default-case (symbol-name operator))
+ *sql-op-table*)))))
+
+(defun sql-operation (operator &rest args)
+ "Returns an SQL expression constructed from the supplied symbol
+OPERATOR representing an SQL operator or function and its
+arguments ARGS. An error of type SQL-USER-ERROR is signalled if
+OPERATOR is not a symbol representing a supported SQL
+operator. If OPERATOR is passed the symbol FUNCTION then the
+first value in ARGS must be a string representing a valid SQL
+function and the remaining values in ARGS its arguments as
+strings."
+ (if (sql-operator operator)
+ (apply (symbol-function (sql-operator operator)) args)
+ (error 'sql-user-error
+ :message
+ (format nil "~A is not a recognized SQL operator." operator))))