this post was submitted on 19 Nov 2023
1 points (100.0% liked)

Lisp

52 readers
3 users here now

founded 1 year ago
MODERATORS
 

As the title says, I am looking for a library that can connect to Progres and execute a stored procedure with either input or output parameters. Or even a user defined function.

I've checked the documentation of these three libraries:

  • cl-progres
  • pg-dot-lisp
  • clsql

but there seems to be no mention or example of executing a stored procedure. Is it just not documented? Are there other ways I can do it apart from these three?

you are viewing a single comment's thread
view the rest of the comments
[–] AxenZh@alien.top 1 points 10 months ago

Thanks. I've come across a page describing how to execute stored procedure in CLSQL:

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")

which is quite similar to Lispworks apart from wrapping the call to the procedure with PL/SQL BEGIN END pair.
(sql:execute-command "BEGIN my_procedure(1, 'foo'); END;")