0

Do anybody know how to insert into table with fields type «clob» a data which after using utl_file will look in the result file like FF FF FF FF in hex-editor? I did the next (and a lot of other attempts):

INSERT INTO DATA.FILE_TAB
(A1 --CLOB type field
)
select 
LPAD(chr(to_number('FF', 'XX')), 22, chr(to_number('FF', 'XX'))) A1
from DUAL;

after inserting I use utl_file (put_line) to create a .dat file in the directory. When I open it, I saw anything but not needed chars. =( In hex-editor I need to see symbols FF FF FF FF FF FF like via the link.

May12
  • 2,420
  • 12
  • 63
  • 99

1 Answers1

0

You can use UTL_RAW package for this purpose

insert into data.file_tab(a1)
values (lpad(utl_raw.cast_to_varchar2('FF'), 22, utl_raw.cast_to_varchar2('FF')));
Marcin Wroblewski
  • 3,491
  • 18
  • 27