Q

Exporting user database from stored procedure

Can I export a user database from a stored procedure or SQL command? How?

Can I export a user database from a stored procedure or SQL command? How?
There is no option on the export utility to export just a stored procedure. If you perform a schema-level export (OWNER parameter) or a FULL export, then you will get stored procedures, but you will also get lots more. If you just want to re-create your stored procedure elsewhere, then I suggest using the DBMS_METADATA package to generate the CREATE command for you, similar to the following:
SELECT dbms_metadata.get_ddl('PROCEDURE','SCOTT','PROC1') FROM dual;
The above will generate the CREATE PROCEDURE command for SCOTT's PROC1 procedure.
This was last published in September 2006

Dig Deeper on Oracle and SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close