How can I append/concatenate BLOB data to a BLOB column using SQL UPDATE command in ORACLE?

You need to create a temporary blob with DBMS_LOB. Createtemporary : SQL> CREATE OR REPLACE FUNCTION CONCAT_BLOB(A IN BLOB, B IN BLOB) RETURN BLOB IS 2 C BLOB; 3 BEGIN 4 dbms_lob. Createtemporary(c, TRUE); 5 DBMS_LOB.

APPEND(c, A); 6 DBMS_LOB. APPEND(c, B); 7 RETURN c; 8 END; 9 / Function created Then you should be able to use it in an update statement: SQL> CREATE TABLE t (a BLOB, be BLOB, c BLOB); Table created SQL> INSERT INTO t VALUES 2 (utl_raw. Cast_to_raw('aaa'), utl_raw.

Cast_to_raw('bbb'), NULL); 1 row inserted SQL> UPDATE t SET c=CONCAT_BLOB(a,b); 1 row updated SQL> SELECT utl_raw. Cast_to_varchar2(a), 2 utl_raw. Cast_to_varchar2(b), 3 utl_raw.

Cast_to_varchar2(c) 4 FROM t; UTL_RAW. CAST_TO_VARCHAR2(A UTL_RAW. CAST_TO_VARCHAR2(B UTL_RAW.

CAST_TO_VARCHAR2(C -------------------------- -------------------------- -------------------------- aaa bbb aaabbb.

You need to create a temporary blob with DBMS_LOB. Createtemporary: SQL> CREATE OR REPLACE FUNCTION CONCAT_BLOB(A IN BLOB, B IN BLOB) RETURN BLOB IS 2 C BLOB; 3 BEGIN 4 dbms_lob. Createtemporary(c, TRUE); 5 DBMS_LOB.

APPEND(c, A); 6 DBMS_LOB. APPEND(c, B); 7 RETURN c; 8 END; 9 / Function created Then you should be able to use it in an update statement: SQL> CREATE TABLE t (a BLOB, be BLOB, c BLOB); Table created SQL> INSERT INTO t VALUES 2 (utl_raw. Cast_to_raw('aaa'), utl_raw.

Cast_to_raw('bbb'), NULL); 1 row inserted SQL> UPDATE t SET c=CONCAT_BLOB(a,b); 1 row updated SQL> SELECT utl_raw. Cast_to_varchar2(a), 2 utl_raw. Cast_to_varchar2(b), 3 utl_raw.

Cast_to_varchar2(c) 4 FROM t; UTL_RAW. CAST_TO_VARCHAR2(A UTL_RAW. CAST_TO_VARCHAR2(B UTL_RAW.

CAST_TO_VARCHAR2(C -------------------------- -------------------------- -------------------------- aaa bbb aaabbb.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions