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

    Requires Free Membership to View

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 first published in September 2006

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.