Hi,
There are some Restrictions on PL/SQL Functions when called from SQL. Read the following excerpt -
-----------START-----------------
Stored functions in SQL offer tremendous power. As you might expect, however, power introduces the possibility of abuse and the need for responsible action...