(jdbc/query db ["select blob_contents from ce_blob where event_id in 
(?,?,?) " [10024279,10024280,10024281]]
            :row-fn (fn [r]
                      (some-> r
                              :blob_contents
                              .getBinaryStream
                              io/input-stream))
            :result-set-fn (fn [rs]
                             (with-open [o (io/output-stream 
"d:/temp/testconc.txt")]
                               (doseq [r rs]
                                 (when r
                                   (io/copy r o))))))

:row-fn is done over every row in the resultset to make an input-stream 
from the blob field
:result-set-fn is done over all results of :row-fn, and concatenates all 
input-streams into an output stream of a file.
doseq is used instead of map, because the main objective of the function is 
to perform side-effects.

Sorry for spamming you, bww00, I was wondering where my replies went, but 
only noticed later I was responding to you personally only <blush>

On Wednesday, January 29, 2014 6:48:58 PM UTC+1, bww00...@yahoo.com wrote:
>
> here is where I have gotten:
> query seems to be getting the blob
>
> I am at a loss on how to get to the blob to say write it to a file, or 
> ultimately construct a blob of multiple blobs
>
> AS usual any help is greatly appreciated
>
>          (jdbc/query db["select blob_contents from ce_blob where event_id 
> =?" 10024279] 
>                 :row-fn(fn[r](some-> r
>                               :blob_contents
>                               .getBinaryStream
>                               io/reader
>                          
>                                  (print r))))
>
> ..........returns
> #<Namespace bww_pnote.core>
> #<BufferedReader java.io.BufferedReader@eb059d> {:blob_contents #<BLOB 
> oracle.sql.BLOB@10d697c>}
> (nil)
>
>
>
>
> On Sunday, January 26, 2014 10:21:18 PM UTC-6, bww00...@yahoo.com wrote:
>>
>> ANyone have some examples reading a blob column from an oracle db.
>>
>> We have a database with a blob column.
>> A entity can be split acroos multiple rows.
>> If there are multiple rows we need to read anc concatenate the rows into 
>> a single buffer
>> There may be multiple rows that we need to read to concatnate the blobs 
>> in this row set 
>>
>> any help would be appreciated
>>
>> Thanks
>> bryan
>>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to