I like to write the below procedure as an anonymous block( as in SQL Server ). How to do the same ? Please explain how to compile and call that block, if return so.
create procedure testproc
if exists(select *from syscat.tables where tabschema = 'DB2' and tabname = 'TESTVIEW' and type ='V') then
drop view testview;
create view testview as select * from test;