IjumpOverU
Technical User
Is there any way to use a variable as a column name in a select statement?
Example:
DECLARE
v_col_name VARCHAR2(40);
v_value VARCHAR2(80);
SELECT v_col_name INTO v_value
FROM table_name;
This is of course a valid sql statement, but I do not want the column name selected into the value variable I want the column name varibale to be referenced as the column in the "table_name" table.
Example:
DECLARE
v_col_name VARCHAR2(40);
v_value VARCHAR2(80);
SELECT v_col_name INTO v_value
FROM table_name;
This is of course a valid sql statement, but I do not want the column name selected into the value variable I want the column name varibale to be referenced as the column in the "table_name" table.