Busca o nome das colunas num SQL dinâmico.
DECLARE cur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR; cols DBMS_SQL.DESC_TAB; ncols PLS_INTEGER; BEGIN DBMS_SQL.PARSE (cur, 'SELECT * from SQ_TENSAO where id = 120', DBMS_SQL.NATIVE); DBMS_SQL.DEFINE_COLUMN (cur, 1, SYSDATE); DBMS_SQL.DEFINE_COLUMN (cur, 2, 1); DBMS_SQL.DESCRIBE_COLUMNS (cur, ncols, cols); FOR colind IN 1 .. ncols LOOP DBMS_OUTPUT.PUT_LINE (cols(colind).COL_name); END LOOP; DBMS_SQL.CLOSE_CURSOR (cur); END; |
Nenhum comentário :
Postar um comentário