[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Inserting a blob using the oracle driver

George Moschovitis

1/21/2005 11:33:00 AM

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

1 Answer

Michael Neumann

1/21/2005 11:56:00 AM

0

George Moschovitis wrote:
> 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