Domanda

I want to dump oracle objects like tables and stored procedures using cx_Oracle from python , is any tutorial how to do this ?

È stato utile?

Soluzione

If you are looking for the source code for tables you can use the following:

select DBMS_METADATA.GET_DDL('TABLE','<table_name>') from DUAL;

for stored procedures you can use

select text from all_source where name = '<procedure name>'

In general this is not a cx_Oracle specific problem, just call the oracle specific tables (like all_source) or functions (like get_ddl) and read it in like any other query. There are more of these sorts of tables (like user_source for source that you the specific user own) in Oracle, but I'm doing this off the top of my head and don't have easy access to an Oracle db to remind myself.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top