Thanks for your reply.
Yes, you are right. This is ok with a 'create procedure'.
But my requirement is an anonymous block, i.e without a 'CREATE PROCEDURE' statement. In this case I need to execute only these statement :
if exists(select *from syscat.tables where tabschema = 'DB2' and tabname = 'TESTVIEW' and type ='V') then
drop view testview;
end if;
create view testview as select * from test;
But the above is not compiling, when I give the same in a file. how to compile this and even if it gets compiled, how to call this anonymous block for execution ?
(as in SQL Server - anonymous block)
Thanks,
Sam