I am using oracle 11g and I just cant under stand where my problem is. I have made much more difficult stuff but I fail in this simple thing for the last 5 hr :
Thi
Pure SQL does not recognize a boolean type, although PL/SQL does. So your query does not know what datatype this function is returning..
The function works, so you could in another pl/sql block use
declare
myvar boolean;
begin
myvar := compt_tree_profile_q.legal_user(1,1);
end;
But you can't use this function in a pure select statement.