A crucial information is missing in your post - which database release?
I suspect it is 8i or earlier, right? Before 9i, Oracle used two different SQL parsers, depending of whether SQL was called from "pure" SQL environment or from within PL/SQL. And in those releases, you could do some things in your SQL, but you couldn't do the same things in SQL from within PL/SQL. Using select statments as an argument of NVL() function was one of them - you can use it in SQL, but not within PL/SQL. From 9i on, the SQL parser is common, so in general you shouldn't have this type of problems any more.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?