Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to save package spec and body under pck file extension?

Blue BirdJan 30 2019 — edited Jan 30 2019

I have a problem in SQLDev 18.4 and I cannot figure it out. It seem to me very simple task, but look like it isn't. I would like to create shorter file names so I decided that I will save SQL source files from procedures and functions under "sql" extension, so I can see already from the file extension what file contain. And Packages under "pck" extension, which is some kind of proposed standard for files which contain both (specification and body).

For example I want to save below Specification and Body in same file (also for easier maintaning):

Create Or Replace Package Test_Package As

Procedure Test;

End;

/

Create Or Replace Package Body Test_Package As

Procedure Test As

Begin

DBMS\_OutPut.Put\_Line('Test');

End;

End;

/

If I save this kind of file under "sql" extension I see this (see toolbar):

pastedImage_11.png

so I can simply run whole script at once with F5. But if I save the same source file under "pck" I see this:

pastedImage_18.png

As you can see there is different icon on the top. This file I cannot run anymore with F5, nor Compile it because it contain / at then end of spec and body. If I remove / then I get another error: "Error(5,1): PLS-00103: Encountered the symbol "CREATE"" which look like expect only spec or body but not both, what is logical.

Under Preferences > File Types I have this settings:

pastedImage_21.png

I also already tried to add .pck extension in settings, but there was no difference, or save under "pkg" extension .... A tried also with selecting All Files first (picture below) when I save file under pck, no difference. Read Jeff post about it, but look like I still don't understood what the problem is.

pastedImage_24.png

Can please some of more skilled 5 millions strong users of SQLDev who read this be so kind and wrote the steps how can I save Package Spec and Body under pck extension so I can run it with F5 like I can run files with SQL extension?

Thanks for your time and answer.

BB

Comments
Post Details
Added on Jan 30 2019
1 comment
3,189 views