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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: