Re: creating maps out of sql

2013-05-25 Thread Mond Ray
My updated approach is now like this: (defn find-uuids [query a2p-id] (sql/with-connection sqlserver (sql/with-query-results rs [query a2p-id] (:uuid (first rs) (defn find-records [{query :main-query from-date :from-date to-date :to-date sub-query-fn :sub-query-fn}] (sql/

Re: creating maps out of sql

2013-05-24 Thread Mond Ray
Thanks - I will check it out. On Friday, 24 May 2013 17:35:46 UTC+2, Niels van Klaveren wrote: > > If you need to do join like operations on database tables from different > sources that you can't join through SQL, there's a nice library called > table-utils

Re: creating maps out of sql

2013-05-24 Thread Mond Ray
Thanks. I had ruled that style of option out as this is small one-off, specific task. On Friday, 24 May 2013 21:41:45 UTC+2, Mark wrote: > > You might want to consider a federated database tool like http://teiid.org > It would be pretty easy to link DB2 and SQL Server. Hooking up the Atom > fee

Re: creating maps out of sql

2013-05-24 Thread Mond Ray
Fantastic answer Marc - I had been fiddling about with map and hash maps and could quite get the parens right but now its sorted. Brilliant - thanks again for the help. Ray On Friday, 24 May 2013 18:56:54 UTC+2, mlimotte wrote: > > Hi Ray, > > First, I'd remove the print(ln)s from the functions

Re: creating maps out of sql

2013-05-24 Thread Mark
You might want to consider a federated database tool like http://teiid.org It would be pretty easy to link DB2 and SQL Server. Hooking up the Atom feed would require a bit more work but probably not too bad. On Friday, May 24, 2013 7:55:17 AM UTC-7, Mond Ray wrote: > > I am starting out to use C

Re: creating maps out of sql

2013-05-24 Thread Marc Limotte
Hi Ray, First, I'd remove the print(ln)s from the functions. No need for side-effects there. Just have the functions return the result value and then when you call a2p-records-by-date you can wrap it in a println. Then you want to create a Map as the return value of the inner loop in a2p-record

Re: creating maps out of sql

2013-05-24 Thread Niels van Klaveren
If you need to do join like operations on database tables from different sources that you can't join through SQL, there's a nice library called table-utilsthat you can use. Since it's not released on clojars there's some steps y

creating maps out of sql

2013-05-24 Thread Mond Ray
I am starting out to use Clojure to combine and verify data between DB2 on a Mainframe, SQL Server and an Atom Feed. Yes, it's such fun working in a start-up ;-) Database wise, all is connecting OK after some Leiningen shenanigans and I am now stuck on the mapping part ;-) The code is below.