Sorry, but I'm drawing a blank on this, and it should be obvious. The result of using exec-raw, to call a stored procedure which returns a single value, is a sequence of a map with a single key-value pair. That's fine, but I can't figure out how to get the single value from this map, because of the second keyword which gets inserted into the key.
In other words,
( defn get-id
[ n_account ]
( let [ seq_id ( exec-raw [ "SELECT OURPACKAGE.get_id( ? ) FROM DUAL" [ n_account ] ] :results )
map_id ( into {} seq_id ) ]
map_id ))
If you call this and try to use the map, there are 2 keywords referenced in the key, which makes it difficult to get any information from:
( def map_id ( get-id 12345 ) )
map_id is now a map with a single key-value pair, which is almost what I want.
{:OURPACKAGE.get_id(:1) "678910"}
So if we try to get the value from this, it returns an error because of the :1 keyword that represents the parameter:
( map_id OURPACKAGE.get_id(:1) )
IllegalArgumentException Wrong number of args passed to keyword: :1 clojure.lang.Keyword.throwArity (Keyword.java:92)
Should I just flatten the map, and get the (1)th element? Or can the original sequence of the map be used directly?