update blob column to a new value with HEXTORAW : blob « Large Objects « Oracle PL / SQL






update blob column to a new value with HEXTORAW

 
SQL>
SQL>
SQL> CREATE TABLE lobdemo (
  2    key NUMBER,
  3    clob_col CLOB,
  4    blob_col BLOB);

Table created.

SQL>
SQL> INSERT INTO lobdemo (key, clob_col, blob_col)
  2    VALUES (50, 'This is a character literal',
  3                 HEXTORAW('FEFEFEFEFEFEFEFEFEFE'));

1 row created.

SQL>
SQL> INSERT INTO lobdemo (key, clob_col, blob_col)
  2    VALUES (51, 'This is another character literal',
  3                 HEXTORAW('ABABABABABABABABABAB'));

1 row created.

SQL>
SQL> UPDATE lobdemo
  2    SET blob_col = HEXTORAW('CDCDCDCDCDCDCDCDCDCDCDCD')
  3    WHERE key IN (50, 51);

2 rows updated.

SQL>
SQL> drop table lobdemo;

Table dropped.

SQL>
SQL>
SQL>

 








Related examples in the same category