DECLARE
table_name_variable VARCHAR2(200) := 'table_1';
zawartosc LONG := 'r.' || COLUMN1_NAME || '' '' || 'r.' || COLUMN2_NAME;
....
FOR r IN (SELECT * FROM table_1) -- 1. I want to use here my TABLE_NAME_VARIABLE instead of pure name of table (table_1).
LOOP
UTL_FILE.PUT_LINE(
file_name,
r.COLUMN1_NAME || ' ' || r.COLUMN2_NAME -- 2. In place of this i would like to use variable called COMMAND := 'r.COLUMN1 || '' '' || r.COLUMN2'
);
END LOOP;
Second point is important for me becouse i want to dynamicly generate the list of columns to write from table_1.
Finally i want to create a procedure with 3 parameters:
1. direction where i want to save my data
2. name of my data file which i want to create
3. TABLE_NAME which i want to save
The most important is question nr 2. Can I do sth like this?