stored proc: working around empty/null values