How to find=grep or maybe sed/awk for multiple lines of text?

Hi,

I am running the following:

PASS="username/password"
sqlplus -s << EOF | grep -v "^$"
$PASS
set feedback off
set heading off
set termout off
select name from v\$database ;
exit
EOF

Which gives

ERROR:
ORA-28002: the password will expire within 5 days
PSMP1

Can anyone advise how I can grep -v the first two lines? Basically I only want to exclude both lines if and only ORA-28002 is the ORA- error encountered. The ERROR: line seems to always precede ORA-28002.

At the moment, it works doing grep -v "^ORA-28002: the password will expire" | grep -v "^ERROR:", but just want to know if there is a shorter option.

Thanks in advance.

I'm a bit surprised, as I'd expect the error message going to stderr, and the select result going to stdout? Then, a redirection like 2>/dev/null should suffice.