Why doesn't this work in IBM Data Studio (Eclipse):
IF EXISTS (SELECT 1 FROM SYSIBM.SYSVIEWS WHERE NAME = 'MYVIEW' AND CREATOR = 'MYSCHEMA') THEN
DROP VIEW MYSCHEMA.MYVIEW;
END IF;
I have a feeling it has to do with statement terminators (;) but I can't find a syntax that works.
Another similar question at http://stackoverflow.com/questions/355687/how-to-check-a-procedure-view-table-exists-or-not-before-dropping-it-in-db2-9-1 suggests that they had to create a proc but this isn't a solution for us.