oraclebloboracle-sqldeveloper

How can I insert into a BLOB column from an insert statement in sqldeveloper?


Is it possible to insert into a BLOB column in oracle using sqldeveloper?

i.e. something like:

insert into mytable(id, myblob) values (1,'some magic here');

Solution

  • Yes, it's possible, e.g. using the implicit conversion from RAW to BLOB:

    insert into blob_fun values(1, hextoraw('453d7a34'));
    

    453d7a34 is a string of hexadecimal values, which is first explicitly converted to the RAW data type and then inserted into the BLOB column. The result is a BLOB value of 4 bytes.