Your question and one of the comments indicate that you want to avoid the PL / SQL and EXECUTE IMMEDIATE blocks. I also assume that by βresponding to other exceptions,β you mean interrupting script execution when an exception occurs.
If so, I think the best you can do in pure SQL / SQL * Plus is to ignore the exception output for the grant statement:
... first part of script (with exit on sqlerror in effect) WHENEVER SQLERROR CONTINUE GRANT EXECUTE ON sys.dbms_result_cache TO my_user; WHENEVER SQLERROR EXIT SQL.SQLCODE ... remaining part of script
source share