I am not able to create this DB2 SP. What is the issue with it? Not getting it
You cannot use a simple SELECT statement in compound SQL. It must be SELECT INTO. Another problem with your code is that all DECLARE statements must come before any other statements.