Toad World® Forums

Save package to local file on compiling?


#1

Hello :slight_smile:

Toad: Version 12.8.0.49
Connected to: 12c DB

Question:
Does Toad offer a way to save a Package to the local file system on compiling the objeckt - e.g. on pressing the F5 button?
I know that I can do this by hand via right click on the package in the schema browser => “Save to file” - at least for packages.
Is there a way to add some portion of automation on this?

Thanks for you input.

Greetings,
John


#2

There is nothing like this in Toad that I can think of. If you’re compiling using F5 you can spool to file.

Example:

SPOOL C:\test.sql
SET FEEDBACK OFF
SET ECHO ON

CREATE OR REPLACE PACKAGE test_package
AS
END;
/

Produces C:\test.sql having…

SQL> CREATE OR REPLACE PACKAGE test_package
AS
END;

I’m not sure how to strip the SQL> from the file there. Perhaps there’s something else that can be done within that script to save the DDL only.