This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-01
Channels
- # announcements (8)
- # aws (8)
- # babashka (21)
- # beginners (125)
- # calva (12)
- # cider (10)
- # circleci (29)
- # clara (6)
- # clj-kondo (34)
- # cljdoc (3)
- # cljfx (65)
- # cljs-dev (18)
- # clojure (38)
- # clojure-australia (4)
- # clojure-berlin (5)
- # clojure-czech (2)
- # clojure-dev (15)
- # clojure-europe (22)
- # clojure-nl (3)
- # clojure-uk (31)
- # clojuredesign-podcast (7)
- # clojurescript (87)
- # code-reviews (1)
- # conjure (3)
- # cursive (2)
- # data-science (1)
- # datalog (1)
- # datomic (36)
- # emacs (12)
- # events (1)
- # fulcro (3)
- # graalvm (68)
- # instaparse (2)
- # jackdaw (2)
- # jobs (2)
- # leiningen (8)
- # luminus (2)
- # nrepl (31)
- # pedestal (44)
- # releases (1)
- # remote-jobs (6)
- # shadow-cljs (4)
- # spacemacs (4)
- # sql (13)
- # tools-deps (56)
- # uncomplicate (4)
- # xtdb (40)
- # yada (11)
I have a question about escaping table names if anyone might have some insight. I'm working with oracle db and have a table named "slash_table/". I can call .getColumns
on the DatabaseMetaData if I use a table name of "slash_table//" and escape the slash myself. However, it returns a tablename of "slash_table/" unescaped. This seems strange to me.
(-> (jdbc/with-db-metadata [metadata (->spec database)]
(jdbc/result-set-seq (.getColumns metadata nil "HR" "slash_table//" nil)))
first
:table_name)
returns "slash_table/"
.I would expect that the table name returned would be a valid table name but that doesn't appear to be so
running the above with "slash_table/"
as the tablename results in ORA-01424: missing or illegal character following the escape character
Did you try "\"slash_table/\""
i.e., SQL-quoting the name? Not sure if JDBC respects that.
"\"slash_table/\""
- missing or illegal character
"\"slash_table//\""
no error but not matching the table
"\"slash_table\/\""
unsupported escape character \/
"slash_table/"
missing or illegal character
"slash_table//"
-> `"slash_table/"
however, when inserting the quotes work: (jdbc/insert! oracle "hr.\"foo//bar\"" {:column1 "single slash?"})
but there they don't need to be escaped (jdbc/query oracle "select * from hr.\"foo/bar\"")
(i have a table foo/bar and foo//bar for testing
databases are weird... ¯\(ツ)/¯