Hi all,
Here's a difficult one:
I already have two tables, Object and Attribute with a one to many relation between them.
I need to set up a table structure to hold all possible select type statements. This needs to be in such a format that it is broken down completely and so that it is reversable, meaning I must be able to reconstruct the select statement from it.
The idea is to create a meta-data structure to hold select statements, but based upon tables similar to the Oracle dictionary tables. Hope this makes sense.
I need to make privision for:
select fld1, fld2, fld3 ...
from tbl1 inner join tbl2 on (fld1 = fld2) left outer join tbl3 on (fld3 = fld4) ...
where fld5 = 'a'
It can even get more complicated:
select fld1 || fld2, subtr(fld3, 1, 30)
from tbl1 inner join tbl2 on (fld1 = fld2) left outer join tbl3 on (fld3 = fld4) ...
where exists (select 1 from tbl4 where fld6 = fl7)
I would like to have included a diagram of some sorts, and I can see the only real way to explain this would be via a diagram. Therefore, I have include my email address for those who would like to send me a diagram as explanation. Preferrably Acrobat Reader, MS Visio or ERWin.
I wish I could give more than 500 points as this is a very difficult question and not for the meek. Even a partial answer, something that can save a simple select statement would be appreciated.
I suspect that the only accurate way to store this would be by using XML in the database. Unfortunately I do not know how. So, if you woul like to suggest this solution, please explain a bit more as to how I can write and access the in there.
Regards,
Johan Swart
jiswart@absamail.co.za
Start Free Trial