Re: is it possible to display contents of a table through stored procedure?
If the structure of the "returned" table is always the same, Global Temporary tables are easier to use for this purpose than Volatile tables. If the structure varies, CREATE VOLATILE TABLE ... AS (SELECT ..) ... may be useful.
If the tablename is a parameter, you'll need to build the SQL statement as a text string and use dynamic SQL [CALL DBC.SysExecSQL(...)], in which case there are some additional restrictions - notably that the creator of the stored procedure must also be the owner of the procedure; e.g. User1 issues "CREATE PROCEDURE User1.MySP ...".