I am trying use the data from a column in one table as column aliases of another table.
DECLARE
var1 VARCHAR(20),
var2 VARCHAR(20);
BEGIN
WITH
TABLE1 AS (SELECT ROWNUM RN, * FROM TABLE)
,A1 AS (SELECT TO_CHAR(VALUE) INTO var1 FROM TABLE1 WHERE RN = 1)
,A2 AS (SELECT TO_CHAR(VALUE) INTO var2 FROM TABLE1 WHERE RN = 2)
SELECT
COL1 AS var1,
COL2 AS var2
FROM TABLE2;
END;
/
This is obviously a simplified version of my actual procedure, but is there a chance I can get some help in understanding why I am receiving the following error from this:
ORA-25408: can not safely replay call
If there is an easier way to go about this task to begin with, suggestions are more than welcome as well!