假设我不知道动态sql会返回哪些字段,我不能去r.columna,r.columnb.etc?
我正在尝试从执行立即打印出多个记录。 这就是我所拥有的:
DECLARE
VTABLE VARCHAR2(30);
SQLS VARCHAR2(1000);
BEGIN
select cola INTO VTABLE
FROM tablea
WHERE ROWNUM < 2;
SQLS := 'select id, width, height, volume, area, price from '||VTABLE;
EXECUTE IMMEDIATE SQLS BULK COLLECT INTO RESULTs;
DBMS_OUTPUT.PUT_LINE('i want to print all the records returned from the dynamic sql query above here');
END;