This content has been marked as final. Show 2 replies
mpatzwahl wrote:Oh dear, that is completely insane. Why not use the one provided?
i try to write my own advisor :-)
You would need to write a SQL parser.
The language definition is here
And don't forget that a function could be used in the condition so you will need to parse PL/SQL also
Try it out on something simple like this and see how far you get
SQL> create or replace function f1 return varchar2 as 2 l_dummy dual.dummy%type; 3 begin 4 select dummy into l_dummy from dual; 5 return l_dummy; 6 end; 7 / Function created. SQL> edi Wrote file afiedt.sql 1 create or replace function f2 return varchar2 as 2 begin 3 return 'X'; 4* end; SQL> / Function created. SQL> create or replace view v as 2 select 3 dummy a, 4 (select dummy from dual) b, 5 f1 c, 6 f2 d, 7 'X' e 8 from dual; View created. SQL> select * from v where c = 'X'; A B C D E - - - - - X X X X X