There was a thread about this some months ago;

  http://groups.google.nl/group/clojure/browse_thread/thread/e95d4778301be699/

Somebody came up with his own version of insert-record:

  http://gist.github.com/373564#LC62


On 2010/08/11 09:10, Shantanu Kumar wrote:

> Hi,
>
> I need to retrieve auto-generated IDs after executing INSERT
> statements (c.c.sql/insert-values ...). Inspecting c.c.sql sources
> reveals that (in c.c.sql/do-prepared) a prepared statement is made
> with the connection and then the SQL statement is run in that context.
> It appears there is a standard API to retrieve the auto-generated IDs:
>
> http://download-llnw.oracle.com/javase/6/docs/api/java/sql/Statement.html#getGeneratedKeys()
>
> However, this method needs the (prepared) statement object to run. I
> would suggest adding another "do-prepared-insert" method that does
> same things as do-prepared but rather return the following:
>
> (.getGeneratedkeys stmt)
>
> Function "insert-values" may be made to call "do-prepared-insert" to
> suit this.
>
> Cheers,
> Shantanu

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to