SELECT ROWNUM,
('TO_CHAR(' || COLUMN_NAME || ') AS FIELD' || ROWNUM) AS COLUMN_NAME
FROM ALL_TAB_COLUMNS
WHERE TABLE_NAME LIKE V_TABLE
ORDER BY ROWNUM
The previous statement is not consistant across databases
(production versus test -- field1 on test may be field 5 on production) I was hoping to order by column_name but I don't know how to get the position of the record) Does anyone know of a way I can get the position of record in the select clause.
('TO_CHAR(' || COLUMN_NAME || ') AS FIELD' || ROWNUM) AS COLUMN_NAME
FROM ALL_TAB_COLUMNS
WHERE TABLE_NAME LIKE V_TABLE
ORDER BY ROWNUM
The previous statement is not consistant across databases
(production versus test -- field1 on test may be field 5 on production) I was hoping to order by column_name but I don't know how to get the position of the record) Does anyone know of a way I can get the position of record in the select clause.