This seems like it should be very easy...anyway, it is in MS SQL Server
In a DB2 stored procedure, how can I just get the value of a variable? Say I have the following stored procedure:
CREATE PROCEDURE etl.TestABC(
)
LANGUAGE SQL
BEGIN
declare Stmt varchar(2048);
set Stmt = 'this is a test';
-- print Stmt;
-- select Stmt;
return 0;
END @
I'd like to print out the value of Stmt after I set it. Print doesn't work, select doesn't work. Somebody said I have to insert it to a table first, and then get it after I run the stored procedure. Is this really necessary?
Thanks, Sylvia
EDIT: I should have made clearer that I want to see the value of Stmt each time after I set it, and I may need to set it multiple times within the same stored procedure.