Tom, I didn't remember exactly conventions OpenACS has used before,
but yes what you describe for p_* and v_* variables sounds excellent
to me.
(At aD, I think the rest of the Muniversal team and I had written
reams of custom PL/SQL in a similar style before most of the aD "core
team" started using PL/SQL much at all. [grumble grumble])
If you occasionally need to use Oracle's namespace qualification
feature on local variables, fine, that's what it's there for. But it
would would much nicer to see it only where it's actually
needed, not willy nilly all over the place in order to make the
variable names as hard to read as possible.
That old style guide Dirk links to above seems awfully mis-guided on
this relatively trivial point. Note that the authors seemed to
confuse two unrelated things, they say: "Name parameters as simply as
possible" and "To achieve this we must fully qualify arguements passed
into procedures" - nonsense, the second statement does not follow from
the first.
Personally it never bothered me at all to call PL/SQL functions with
parameters named "p_foo" rather than "foo", but if you really hate
that, that does not mean that your only other option is to
use namespace qualification all over the place. Rather obviously, you
can simply declare a "p_foo" or "v_foo" variables near the top of your
function, and initialize "v_foo" to the passed in value of "foo". Not
necessarily ideal, but for a long function, that is going to be much
clearer than prefixing the variable with the function name dozens of
times throughout the code.