You can get the DDL of a table by executing DBMS_METADATA.get_DDL('Table','TABLENAME')
. I'm looking for a way to change the name of the table in the DDL and then execute the DDL to create an equivalent table with a new name and an additional column.
DECLARE
stmt clob;
BEGIN
SELECT dbms_metadata.get_ddl('TABLE', 'TABLE_NAME') into stmt FROM DUAL;
/*change the name*/
EXECUTE IMMEDIATE(stmt);
END;
Try this :