Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> urgent???????
Dear all
I have a problem and I do not what to do.
my problem is:
I have a table of 2 columns id number, text(contains text) long raw
I want to select a specific text from the table and convert it to varchar2
and write it to file
so I create the following procedure.
procedure test1 is
mm long raw;
xx long raw;
I UTL_FILE.FILE_TYPE;
begin
I := UTL_FILE.FOPEN ( 'c:\bassem\','test.txt' ,'w');
select text into mm from om_sqltext_info where id=15972;
/* I WANT TO TAKE A PART OF THE LONG RAW BECAUSE IT IS GREATER THAN 32760 */
xx:=utl_raw.SUBSTR (mm,1,200);
UTL_FILE.PUT(i,utl_raw.cast_to_varchar2(xx));
UTL_FILE.FCLOSE(i);
end;
but when I run this procedure I get the next error
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.UTL_RAW", line 299 ORA-06512: at "WORKBENCH.TEST1", line 8 ORA-06512: at line 1
I do not what is cause if any one know please replay as soon as possible.
note:
when I run this procedure on smaller text (the text size is smaller than
32760) so there is no need to xx:=utl_raw.SUBSTR (mm,1,200);
in this case the procedure succeeded and write to file.
Best Regards
Mohamed Gad
ITSoft, The software Factory of International Turnkey Systems (ITS)
16 Lebanon st., Mohandeseen, Giza, Egypt
Tel: +20-2-3048561/2/3
Fax: +20-2-3048564
email: mgad_at_itsoft.com.eg
Received on Mon Jun 26 2000 - 16:25:31 CDT