Re: Long fields in SQL*Forms 3.0

From: Ian A. MacGregor <ian_at_tethys.SLAC.Stanford.EDU>
Date: Thu, 6 Jan 1994 15:52:55 GMT
Message-ID: <CJ7tG9.J4p_at_unixhub.SLAC.Stanford.EDU>


In article <2gf307$okf_at_linus.mitre.org>, mnc_at_mitre.org (Marc Cannava) writes:
|>
|> I'm setting up a new database in Oracle V6 running Forms V3. We have
|> a "Comments" field in the database, a LONG field, and we wish to
|> display it on a multi-line field in the form. However, we are unable
|> to specify a multi-line field without having the user call up the
|> "field editor". Is there any way to have the form simply come up with
|> some fields displayed as multi-line?
|>
|> Thanks for your help!!
|>
|> \marc
|>
|> --
|> Marc N. Cannava | Tigers are nimble,
|> Technical Staff, The MITRE Corporation | And light on their toes,
|> Email: mnc_at_mitre.org | My RE-spect for tigers,
|> Phone: 617-271-3342 Fax: 617-271-7722 | Continually grows. --Hobbes

In their book Oracle Forms Developer's Companion, Mssrs. Andrew Yang, Brian Adams and Steve Muench describe another method to have a multi-line field. Their method works with char datatype fields, i.e. up to 255 characters under V6. I've got forms which employ this method, but I also need to display about one screenful of data , about 1260 characters as well. What I did is to make a copy of one of the procedures, PP_ML_WRITE, from the book and made the following changes to the copy called PP_ML_WRITE_LONG

       change the declaration of the variable lv_wrk from  char(256) to
       char(1261).

       change the assignment of lv_wrk  in the first else statement to not
       use name_in, i.e. lv_wrk = :[long_field_name];

This was done as name_in returns a char and this truncates a long field. Of course by doing this the procedure is not generic.

I also made a copy of PP_ML_READ called PP_ML_READ_LONG and made the following change to that copy

       change the declaration of the variable lv_wrk from  char(256) to
       char(1261).

The method also uses functions which I converted to procedures with in out parameters and made the appropriate changes to the calling procedures.

I then made the following changes to the triggers given in the book

the Post-Query trigger for the block with the long field was changed to call

        PP_ML_WRITE_LONG vs. PP_ML_WRITE

the Pre-Insert and Pre-Update triggers for the block with the long field were changed to call

        PP_ML_READ_LONG and PP_ML_WRITE_LONG  
vs.     PP_ML_READ and PP_ML_WRITE    


All other procedures I left the same.

                          Ian MacGregor
                          Stanford Linear Accelerator Center
                          (415) 926-3528       
Received on Thu Jan 06 1994 - 16:52:55 CET

Original text of this message