Question

my programming group has a dozen schemas and select few of them are getting quite crowded with stored procs/functions/packages. Is is possible to add folders to an oracle schema? Or is it otherwise possible to give a schema sturcture?

Things that immidiately come to mind is (a) renaming the procedures and functions by prefixing them with a namespace (b) moving function/procs into packages, or (c) splitting up the schemas into more schemas all based on the part of the website they service... but I still have hopes for a folder organization. Is it possible to add a folder? how do you organize your stored procs/functions/packages?

Thanks, user 1778606

Was it helpful?

Solution

There is no way to create "folders" to create multiple namespaces in a schema.

Procedures and functions are organized into packages. Packages exist in a schema. In a real environment, it would be very unusual to want to create a standalone procedure or function. Virtually every procedure belongs in a package with related methods.

It would seem unusual that you would really want more levels of organization. A procedure or function should only be declared in the package specification if it needs to be called from outside the package-- otherwise, it can simply be a private method in the package. If you're factoring out very localized bits of code that should only be called from one method, you can nest PL/SQL blocks and define procedures within procedures. If you're organizing things well, most of your code is probably private methods in a package. If you find yourself drowning in many similarly named packages, I would tend to suspect that you need to reconsider how your code is organized.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top