Home » Developer & Programmer » Forms » text_io package
text_io package [message #179073] Sat, 24 June 2006 12:53 Go to next message
ranisri321
Messages: 22
Registered: March 2006
Location: hyderabad
Junior Member
i have one text item&one multiline text item.i want to enter the path of the os file in textitem1.the data of this file should be display in the textitem2
I want to retrive the data of text file into multi line text item.
iam not getting with text_io package
please help me.
Re: text_io package [message #179127 is a reply to message #179073] Sun, 25 June 2006 22:37 Go to previous message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

is it simple file display from text to form text item?
you may try this.

 

DECLARE
  in_file     text_io.file_type;
   v_filename  VARCHAR2(100);
   v_length    NUMBER;
   v_contents  VARCHAR2(100);
   linebuf     VARCHAR2(1000);
   v_start     NUMBER;
   p_string    VARCHAR2(1000);
BEGIN
  v_filename := :block3.file_dir;
  
  in_file := text_io.Fopen(v_filename,
                           'r');
  
  LOOP
    v_start := 1;
    
    text_io.new_line;
    
    text_io.Get_line(in_file,
                     linebuf);
    
    p_string := Ltrim(Rtrim(Substr(linebuf,
                                   v_start,
                                   v_length)));
    
    :block3.contento := :block3.contento || p_string;
    
    text_io.new_line;
  END LOOP;
END;



Previous Topic: time_expired problem
Next Topic: Resize my application
Goto Forum:
  


Current Time: Fri Sep 20 09:28:53 CDT 2024