Looking through the user's manual of CLSQL, it doesn't look like there
is any facility to call stored procedures. Has anyone, in fact, built
anything on top of it that does so? Or is it (un)desirable to do so?
Working right now with SBCL 1.0.5 and MySQL 5.0.27.
Cheers,
JD
if you want just execute stored procedure then
(execute-command "sp_bla 1, 2")
If your stored procedure returns table or single value then
(query "sp_bla 1, 2")
On May 25, 10:31 pm, Vagif Verdi <···········@gmail.com> wrote:
> if you want just execute stored procedure then
> (execute-command "sp_bla 1, 2")
>
> If your stored procedure returns table or single value then
> (query "sp_bla 1, 2")
I see, indirect support. Thanks.
Cheers,
JD
········@gmail.com writes:
> On May 25, 10:31 pm, Vagif Verdi <···········@gmail.com> wrote:
>> if you want just execute stored procedure then
>> (execute-command "sp_bla 1, 2")
>>
>> If your stored procedure returns table or single value then
>> (query "sp_bla 1, 2")
>
> I see, indirect support. Thanks.
Well, what about:
(define-stored-procedure (name arglist &key stored-name gives-results)
(let ((stored-name (or stored-name
(substitute #\- #\_ (string-downcase name)))))
`(defun name arglist
(,(if gives-results 'query 'execute-command)
,@(com.informatimago.common-lisp.source-form:make-argument-list
(com.informatimago.common-lisp.source-form:parse-lambda-list arglist))))))
So you can write:
(define-stored-procedure sp-blah (a b) :gives-result t)
(dolist (row (sp-blah 1 2))
(print row))
--
__Pascal Bourguignon__ http://www.informatimago.com/
NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.