This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-17
Channels
- # announcements (4)
- # aws (17)
- # beginners (108)
- # calva (2)
- # clojure (164)
- # clojure-austin (1)
- # clojure-europe (3)
- # clojure-italy (1)
- # clojure-nl (17)
- # clojure-uk (98)
- # clojurescript (31)
- # code-reviews (1)
- # cursive (23)
- # data-science (1)
- # dirac (6)
- # emacs (21)
- # figwheel-main (1)
- # fulcro (53)
- # graphql (2)
- # hoplon (1)
- # lein-figwheel (1)
- # leiningen (2)
- # lumo (21)
- # off-topic (118)
- # onyx (4)
- # pathom (59)
- # pedestal (2)
- # planck (3)
- # reagent (47)
- # reitit (2)
- # shadow-cljs (258)
- # spacemacs (3)
- # sql (10)
- # tools-deps (37)
What is a good use case for a database trigger?
@drewverlee Some context for your question?
I haven't used triggers for a very, very long time. I'm not sure I even remember what I used them for, way back when...
@seancorfield the context is that we some functionality of our system has a dependency on the database having certain relationships and in an effort to do some performance testing we would like to clone those database relationships. I'm able to build something that can insert data into our database to mimic those relationships, but i can't think of a way to even capture what effect the current triggers will have. e.g if i insert a parent bc all children has a fk dep on parent then a trigger might give that child a parent as well.
@drewverlee So, it's the triggers in the current system that are already causing you pain?
Hi! Starting to work with a Sql Server data base. We are able to query selects but don’t know how to call to a stored procedure, we have been trying with clojure.java.jdbc/db-do-commands
and clojure.java.jdbc/db-do-prepared
but we haven’t been able to get anything. Could someone help us? Thank you!
@usasigain You should be able to use jdbc/query
for that, with EXEC schema.dbo.procname arg1 arg2
as the SQL string I think.
clojure.java.jdbc
simply passes the SQL string to the JDBC driver, after creating a PreparedStatement
and setting any parameters.
Is the problem that Microsoft's JDBC driver doesn't support EXEC
in a PreparedStatement
? Are you getting an error?
@seancorfield ou! it works, I think we tried this at the beginning but maybe with the wrong string… And then we were over thinking it.
Calling a simple Stored Procedure with no parameters this way works for us:
(jdbc/query spec ["EXEC schema.dbo.procname"])
Thank you for your quick response!