How can I, in Oracle 11, insert large data (~100000 hex-digits) into Blob field, using sql command only (without any external data with load
cluase or such).
update tablename set fieldname='AA';
Works - 1 byte;
update tablename set fieldname='AA...(4000 hex-digits)...AA';
Doesn't. Niether Concat
helps; strings can't be larger than 4000 chars. Is there other 开发者_StackOverflow中文版way, using sql command only?
As far as I know it is not possible. What you can do is:
- select blob from table
- get blob from resultset
- get outputstream from blob
- write to stream
- flush and update blob in table
- commit
You should be able to replace steps 1-2 by creating a temporary blob and using that for writing and updating.
DECLARE
buf RAW(100000);
BEGIN
buf := hextoraw('626567696E2030207575656E636F64652E6275660D0A6');
UPDATE tableName SET columnName = buf;
--or
INSERT INTO tableName(charColumn, BlobColumn) values ('Sting', buf);
END;
精彩评论