Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Data quality ranking problem
Hi,
I have to implement a simple data quality ranking system.
Say, we have a relation A
ID NUMBER PRIMARY KEY,
FOO NUMBER,
BAR VARCHAR2
(in my real project, A has many more (too many) columns...)
I am given a ranking table (data view here): COL_NAME RANK
For some given row in A, compute a score. Start with 0. If the FOO field is not NULL, add 10. If the BAR field is not NULL, add 15, etc ....
Does anyone know a solution? It resembles a little of reflection -- find a field by its name, but the name is not known statically. Of course I could make a huge PL/SQL thing with IF or CASE, but there may be a more elegant solution?
Part 2:
Add a relation B
ID NUMBER PRIMARY KEY,
KEY_A NUMBER, -- foreign key to A
FOOBAR NUMBER
FOOBAz NUMBER
I also have ranks for columns in B that have a key to the row in A that I want to rank:
COL_NAME RANK
I am not afraid of having to solve it myself, but if someone knows the situation and a solution, I'd be happy to hear about it.
Soren Received on Thu Sep 14 2006 - 02:23:05 CDT
![]() |
![]() |