Clojure JDBC error with Oracle... java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement

374 views Asked by At

In Oracle's SQL developer, I have created a table named BBS_COUNT_BASES with the following definition:

CREATE TABLE BBS_COUNT_BASES
   (    BASE_COUNT NUMBER NOT NULL, 
    BASE_EDN CLOB NOT NULL
   )

I have also inserted a record into the table using the statement:

INSERT INTO BBS_COUNT_BASES (base_count, base_edn ) VALUES (100, '{}')

Now, using SQL Developer, I can use the statement

UPDATE BBS_COUNT_BASES SET base_edn = '{}' WHERE base_count = 100

to update the base_edn value to (in this test case) the same value.

However, when I attempt to pass this statement to clojure.java.jdbc/query, the JDBC driver errors out with the error shown in the title. Does anyone have any clue why this statement is being seen as invalid by the JDBC driver?

1

There are 1 answers

0
Yuri Steinschreiber On

You cannot issue an UPDATE statement using query. JDBC segregates queries and updates in its interface, that's the meaning of the exception you are getting. Use clojure.java.jdbc/update!