Inserting a blob using the oracle driver

G

George Moschovitis

Hello everyone,

I am not experienced with Oracle and I have to insert a blob
to a database. Is there an escape method in the Ruby Driver?

I would like to do something simple like:

blob = File.read('blob.bin')
db.exec("INSERT INTO my_table (the_blob) VALUES ('#{escape(blob)}')")

Is this possible? Any help will be appreciated!
regards,
George Moschovitis
 
M

Michael Neumann

George said:
Hello everyone,

I am not experienced with Oracle and I have to insert a blob
to a database. Is there an escape method in the Ruby Driver?

I would like to do something simple like:

blob = File.read('blob.bin')
db.exec("INSERT INTO my_table (the_blob) VALUES ('#{escape(blob)}')")

Is this possible? Any help will be appreciated!

With the Oracle7/8 driver I used for the DBD::Oracle, you just had to
specify the type when calling #bindrv as LONG_RAW.

Regards,

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top