you should use PL/SQL, declare a LONG type variable, make a cursor on view_name & text, insert text into your variable, and now you can do : if (longvar like '%E') ...