Re: Forms 4.5 - populating fields with data from an external text file?

From: John Strange <jstrange_at_imtn.dsccc.com>
Date: 1998/01/29
Message-ID: <6aqha9$iog$2_at_psun6.dsccc.com>#1/1


Try the help button on the Developer 2000.

Code snippet to write to file and read from file

declare
  file text_io.file_type;
  fileName varchar2(255) := 'c:\tmp\stuff.tmp';   line varchar2(2000);    

begin
  file := text_io.fopen(fileName, 'w');

          YOUR CURSOR SELECT INTO TEXT HERE
 text_io.put(file, :text);
  text_io.fclose(file);   

  :text := '';
  file := text_io.fopen(fileName, 'r');
  loop
    text_io.get_line(file, line);

        YOUR CODE HERE
  end loop;  

exception
  when no_data_found then
    text_io.fclose(file);
/* And remove temporary file... */
end;

Jason Nugent (ap958_at_chebucto.ns.ca) wrote:

: Hi all,
 

: Forgive me if this question has been asked before, but I have search
: dejanews and so on but haven't found the answer. Can Forms 4.5 read
: data from a text file (delimited or otherwise) to populate its fields?
: We would like to allow users to store partially completed records on the
: local file system (and also completed ones, for export reasons), and
: then let them "Retrieve from File..." later on and simply open the text
: file and have Forms 4.5 populate its fields by reading data from it. I
: know that SQL*Loader will allow reads from delimited files into tables,
: but what about Forms? This question is a stumbling block in our
: development process. If we have to, I suppose we could store the data
: in a temporary table (instead of a the "official" one, which will be
: Trusted Oracle on Trusted HP/UX), but the file export/read option was
: requested by the client.
 

: Thanks to all,
 

: Jason Nugent
 

: --
: ---------------------
: Jason Nugent, BSc(Hons), CWM
: ap958_at_chebucto.ns.ca "Beneath this canvas monochrome
: Certified Webmaster Wrapped in the shroud of this grey home
: Member, HTML Writer's Guild I'll paint a picture all my own
: Member, Webmaster's Guild I'll paint a picture"
 

: Live to ride,
: Ride to Live. -Anacrusis
 

: ********************************************************************
: The Best Place for Sport on the net! - Sportscience www.sportsci.org
: ********************************************************************

--
While DSC may claim ownership of all my ideas (on or off the job),
DSC does not claim any responsibility for them. Warranty expired when you
opened this article and I will not be responsible for its contents or use.
Received on Thu Jan 29 1998 - 00:00:00 CET

Original text of this message