Using column value as table name to delete records
I am using Oracle 8i.
I need to write an Oracle SQL Script to delete records from the selected tables (i.e. EMPLOYEE and ACCOUNT tables, where the TABLE_TYPE column value of MAP_TABLE table is equal to 'A'). But the table names are stored in TABLE_NAME column of MAP_TABLE.
Question 1: How to write the delete statement script for EMPLOYEE and ACCOUNT tables by using the TABLE_NAME column values that retrieved from MAP_TABLE.
Question 2: How to use the TABLE_NAME column values to select a particular field in script, eg. EMP_NAME field of EMPLOYEE table.
TABLE_NUMBER, TABLE_NAME, TABLE_TYPE
1, EMPLOYEE, A
2, ACCOUNT, A
3, STOCK, B
4, RAW, C
100, James Mil
200, Tom Cris