Append Blob Data using SQL statements (Through Vb6 ADDO)
Posted on 2005-05-05
I have a row with a column defined as BLOB (Size: 1 MB).
I used VB 6 ADDO to insert records into the DB2:
cmdstr = "INSERT INTO event(eventtype, eventdata) VALUES ("3002," + ", BLOB(X'" + data + "'))"
INSERT INTO event(eventtpe, eventdata) VALUES ( '3002', BLOB(X'AB10BA') )
The column, eventdata is in Blob format.
I used the string, data (defined as string type) to hold a long string of hexadecimal values.
When the length of the hexadecimal string reaches greater than 34000 characters, I got an SQL error stating that the string is too long.
I think that the SQL statement has a limit of how long can a SQL statement be.
So the only way is to insert the data seperately into DB2.
I want to enter the whole of the data Blob into a SINGLE row / record.
Therefore, I need to append the Blob data.
Content of Blob:
After appending to the existing Blob data and it wil becomes what is shown below after another SQL statement: