Thread: MSWord .DOC to BLOB
12-01-03, 14:29 #1Registered User
- Join Date
- Jul 2003
Unanswered: MSWord .DOC to BLOB
I'm looking for the correct syntax to insert/retrieve a Blob from an Oracle table.
Any help would be gr8ly appreciated.Program, that's what I do.
12-02-03, 00:34 #2Registered User
- Join Date
- Nov 2003
- Bangalore, INDIA
create table test_lobs (
C4 blob )
Insert some rows.
The empty_<lob>() function acts as a constructor to generate a LOB locator for that column. Without a locator that LOB cannot be accessed through PL/SQL etc.
First row - no locators.
insert into test_lobs values (1,null,null,null)
Second row - "null" locators - ie locators created but point to nothing. Note there is not an empty locator as such for the BFILE though we could also initialise the BFILE using BFILENAME with a null directory and file, ie BFILENAME(null,null).
insert into test_lobs values (2,EMPTY_CLOB(),null,EMPTY_BLOB())
Third row - it is possible to insert data directly up to 4K. Even though you are only really accessing the locator, the data is stored as appropriate behind the scenes. When inserting directly into a BLOB either the string must be hex as an implicit HEXTORAW will be done or you can call UTL_RAW.CAST_TO_RAW('the string') to convert it for you. Note '48656C6C6F' = 'Hello'.
insert into test_lobs values (3,'Some data for record 3.',BFILENAME(null,null),'48656C6C6F'||UTL_RAW.CAS T_TO_RAW(' there!'))SATHISH .