Wednesday, November 28, 2007

Program for Formatting options for fnd_file.put_line.out and Log

create or replace procedure XXBOB_FND_MULTILINE_PRINT_PROC(P_TEXT varchar2,P_FRAME_SIZE NUMBER )as
v_text varchar2(1000) ;
v_cut number;
v_print_text varchar2(1000);
v_next_start number;
v_tot_length number;
v_cut_length number;
v_fram_size number :=4;
x number;
begin
v_text:=P_TEXT;
If p_frame_size is null then
V_fram_size:=60;
end if;
v_fram_size:=p_frame_size;
v_cut:=instr(v_text,' ',v_fram_size);
v_tot_length:=length(v_text);
v_print_text:=substr( v_text,1,v_cut);
v_next_start:=v_cut+1;
dbms_output.put_line('Total Length:'v_tot_length);
x:=length(v_print_Text);
dbms_output.put_line('X:'X);
if length(v_text)>v_fram_size then
loop
--dbms_output.put_line(v_print_Text);
fnd_file.put_line(fnd_file.output,v_print_Text);
--dbms_output.put_line(v_print_Text);
v_cut:=instr(v_text,' ',v_next_start+v_fram_size);
if v_cut=0 then
v_cut:=v_tot_length+1;
end if;
v_cut_length:=v_cut-v_next_start;
--dbms_output.put_line('v_next_start:'v_next_start);
--dbms_output.put_line('v_cut:'v_cut);
--dbms_output.put_line('v_lenghtcut:'v_cut_length);
v_print_text:=substr( v_text,v_next_start,v_cut_length);
x:=nvl(length(v_print_Text),0);
--dbms_output.put_line('X:'X);
if xv_next_start and v_cut!=v_tot_length then
v_next_start:=v_cut+1;
end if;
exit when x
end loop;
else
fnd_file.put_line(fnd_file.output,v_Text);
--dbms_output.put_line(v_Text);
end if;
end;

4 comments:

Unknown said...
This comment has been removed by the author.
Unknown said...
This comment has been removed by the author.
Unknown said...
This comment has been removed by the author.
Insulation Contractors Carmel said...

Great post thankss