Re: [Q] Field formatting. How do you split one field to four.

From: Kenneth Atkins <katkins_at_olywa.net>
Date: 1996/08/07
Message-ID: <3208B04B.3D6B_at_olywa.net>#1/1


msoppitt_at_eastman.co.uk wrote:
>
> Forms 4.5
> I have four fields, value 99 each and go to make one database field of
> ie 01||03 ||01||05 each set of two figures represent a description
> from an Lov (ie 4 diferent lovs make a discription that = A,B,C,D).
> How do i read the 8 numeric field from the database (ie on query) and
> split it into the four fields.
> I tried using a hidden box over the four 99 fields which would display
> for query mode and hide for insert but this is a bit messy.
>
> Any suggestions would be more than appreciated.
> Thanks, Michael

The standard way to do this (in 3.0 and I assume in 4.5) would be to create a 4 non-base fields to actually display and query the field's data, and make the real field non-displayed. You then have to add code to the POST-QUERY trigger to populate the 4 fields when a record is queried, and a PRE-QUERY trigger to take the query input from the 4 fields and put them together and place them in the real field so the query will work, and then a WHEN-VALIDATE or PRE-INSERT/PRE-UPDATE trigger to take the inputted or updated values of the 4 fields and put them together into the one real field.

Hope this helps!



Ken Atkins - Senior Oracle Consultant - ARIS Corporation (katkins_at_olywa.net)

In an effort to contribute some content to the Web I have created an 'Oracle Tip of the Week' site:

   http://www.olywa.net/katkins/oratip

Check it out!


Received on Wed Aug 07 1996 - 00:00:00 CEST

Original text of this message