Sample Header Ad - 728x90

Altering Tables using Tablenames from other Table

0 votes
1 answer
46 views
I have a database with several tables and i have a table which contains all tablenames which I want to alter. I want to perform a query like this: ALTER TABLE (SELECT "TABLE_NAME" FROM "RESOURCE_TABLES) DROP COLUMN ID; My Table RESOURCE_TABLE with Table Names: TABLE_NAME ID Table1 1 Table2 2 Table3 3 ... ... How can I alter all tables named in the table in the column TABLE_NAME with a loop or a query? So i want Table1,Table2,Table3 to drop a column id without executing a single alter table query on each table because maybe the tables are 100 Tables.
Asked by DataLordDev (63 rep)
Jul 24, 2019, 02:26 PM
Last activity: Jul 26, 2019, 01:11 PM