is there an easy way to display/print a variable on the output of the IBM i ACS Run SQL Script screen?
For having a quick check when writing a script it would very helpful to be able to display the content of a variable. E.g. in below script, I want to know the value of "my_counter".
BEGIN
DECLARE my_counter INT;
SET my_counter = my_counter + (SELECT count(*) FROM QSYS2.OBJECT_LOCK_INFO WHERE SYSTEM_OBJECT_SCHEMA = 'ABC' AND SYSTEM_OBJECT_NAME = 'DEF' AND OBJECT_TYPE = '*FILE');
SET my_counter = my_counter + (SELECT count(*) FROM QSYS2.OBJECT_LOCK_INFO WHERE SYSTEM_OBJECT_SCHEMA = 'ABC' AND SYSTEM_OBJECT_NAME = 'XYZ' AND OBJECT_TYPE = '*FILE');
PRINT my_counter; --> I want to print the content of variable my_counter but PRINT is not a valid keyword (all other valid keywords have a blue color, this one does not).
END;
You probably also notice that I'm doing "my_counter = my_counter + ...", I tried using "my_counter += ..." but no such thing. Is there a better way of doing this?