Re: Double data entry
Date: Tue, 21 Mar 2000 16:56:19 +0100
Message-ID: <38D79BA3.BD0C4709_at_kksl.uni-leipzig.de>
Rainer Kagerer schrieb:
> Just try to select your entry from the database to forms.
> Then change it with sqlplus on the database and you will see you
> wont be able to change it in forms.
Thanks for your suggestion, but it would not work for me, because also the second data typist has to put in all data on the second data entry. He/she can also do a mistake, and must be able to correct it.
Now I have a slightly different strategy for my double data entry:
Both data typists put their data in a different record. When the second one saves his/her entry a third record is created and filled with the data that are equal in the first and second entry. All other fields must be reentered by the second data typist.
For this I use two cursor variables that hold the first and the second entry. Now I want to go through all fields of one table with a loop and compare the fields. But I have problems to get the data from the cursor variables:
Here is the code, maybe it helps:
declare
first_rec table%rowtype; -- first entry second_rec table%rowtype; -- second entry
begin
...
select *
into first_rec from table where patid = current_patid and entry_number = 1; select * into second_rec from table where patid = current_patid and entry_number = 1;
...
actual_field := get_block_property('table', first_item); last_field := get_block_property('table', last_item);
loop
- Now we reached the point of my problem
- I canīt get the values from the cursor variables for comparing as long as
- I want to use the variable 'actual_field' in the call of the cursor variable
- Is there a way to change the 'actual_field' at runtime in order to
- get the values from different fields at each loop, like with the
- name_in-function for normal variables?
if first_rec.actual_field = second_rec.actual_field -- both values equal -- put in the data from the second entry (I donīt know how) else -- values not equal message('Not equal'); -- Mark field red set_item_property(actual_field, background_color, 'r255g0b0'); end if; exit when actual_field = last_field; actual_field := get_item_property(actual_field, nextitem);end loop;
end;
I hope I didnīt confused you too much.
Iīll be very glad, if someone can help me with this...
Thanks,
Jan Schaefer Received on Tue Mar 21 2000 - 16:56:19 CET