Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> checking of variables that are recorded twice
I've got the following problem :
to check data quality all variables from a study (several hundred in about
30 tables) have to be entered twice.
In order to compare the two field values I liked to write a procedure which
should be called by a post-change-trigger in the form for the second data
entry and which accepts the field and tablename of the actual variable as
parameters.
Example :
After editing the field 'ENTRY-DATE' of the table 'PATIENT' in the second
entry-session there should be run an automatic query of the respective table
from the first session as
PROCEDURE CHECK_VALUE (patid NUMBER, var_name CHAR, first_tab_name CHAR) IS
oldval CHAR;
SELECT var_name INTO oldval FROM first_tab_name a
WHERE a.pat_ID = patid;
...
END CHECK_VALUE;
The replacement of the respective table- and variable names by those
parameters doesn't work in the SELECT - Statement.
Is there any other efficient way to run such an automatic SELECT without
having to write that statement explictely for all variables ?
I'm very grateful for any suggestion,
best regards
Susanne
Susanne Stolpe phone : (49) 234 700-4858 Ruhr-University Bochum, FRG fax : (49) 234 7094-325Dep. of Medical Informatics,