Home » Developer & Programmer » Forms » TEXT FILE LOADING IN FORM
TEXT FILE LOADING IN FORM [message #261671] Thu, 23 August 2007 05:30 Go to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

am using this code to load text file in form ..
my text file is like ..

JIM 12000 HOME
ALIAN 34000 RENT
---------------------
Declare
  LF TEXT_IO.FILE_TYPE;
  LL VARCHAR2(32000) ;
  filename varchar2(100);
Begin
 
begin
	     filename:=GET_FILE_NAME('c:\', File_Filter=>'Text Files (*.txt)|*.txt|');
       LF := TEXT_IO.FOPEN( filename, 'R');
  Exception
  	when others then
  	   message( 'Cannot open file' || 'salary' );
  	   raise ;
  End ;
  -- OK, file is open --
  Begin
    -- Read the lines --
    Loop
      TEXT_IO.GET_LINE( LF, LL ) ;
      :MAIN.GET_F := :MAIN.GET_F || LL ;
      Text_IO.New_Line;
      TEXT_IO.GET_LINE( LF, LL ) ;
      :MAIN.GET_F2 := :MAIN.GET_F2 || LL ;
    End loop ;
  Exception
    When no_data_found Then
      -- end of file --
      TEXT_IO.FCLOSE( LF) ;
  End ;
 
End; 

-----------------------------
problem is..This code load [JIM 12000 HOME] in one text field
while i want to load jim in seperate text field,12000 in seperate text field and HOME in seperate field while they are in same line in text file.
How to change that code to do this ..
Can Any one help.Or give some idea.

[Updated on: Thu, 23 August 2007 05:40]

Report message to a moderator

Re: TEXT FILE LOADING IN FORM [message #261884 is a reply to message #261671] Thu, 23 August 2007 23:20 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Use the various string functions of Oracle PL/SQL to find the 'separaters' and 'cut' the line into pieces.

David
Previous Topic: How to generate sequence number through Developer 6i? (merged by LF)
Next Topic: report does not open via we.show_document from forms
Goto Forum:
  


Current Time: Sat Dec 03 01:35:09 CST 2016

Total time taken to generate the page: 0.11450 seconds