0

I have a Oracle database, that contains metadata of Database Tables. Example.

Table- Entity Entity Property
Emp Table
Position Table

Table Attributes
Attributes Table_Name
Emp_Name Emp
Emp_No Emp
Emp_Add Emp
Postion_id Position
Position_Name Position

I want a python script which you create DDL for the above tables. For example, the output should contain like this tables
create table 'emp','details'
create table 'position','details'

For Attributes, I would like the script to output like this
put 'emp','1','details:Emp_Name','1'
put 'emp','1','details:Emp_No','1'

Please, advise me.

1 Answer 1

1

Maybe you should pay attention on DBMS_METADATA package.

For example:

select DBMS_METADATA.GET_DDL('TABLE', 'EMP') from dual;

link on documentation.
It is available for all Oracle users.

Sign up to request clarification or add additional context in comments.

1 Comment

We are building the table structure from the entries from another table. The DBMS_METADATA will not work in this case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.