1 Reply Latest reply: Dec 13, 2012 11:34 AM by JustinCave RSS

    How to merge three SQL packages into one package?

      Dear Folks, I have three sql pacakges (1d.pks, 1d.pkb , 2d.pks, 2d.pkb, 3d.pks, and 3d.pkb). Each package has slight different code in their body but I need to combine all them into one single package. I can do this manually by comparing each line of code and keep making changes but I was wondering if there is an easier way to do it. Kindly let me know if you need more information. Thanks in advance.
        • 1. Re: How to merge three SQL packages into one package?
          If you have three pieces of code in any language that do similar things, you would want to refactor them, pulling out common elements into reusable components. It is no different with PL/SQL. Most of the effort in refactoring code goes into figuring out what those reusable components are and figuring out the appropriate interface for those components. Any reasonable IDE will provide you tools that automate the tedious bits of refactoring-- renaming variables, breaking a section of code out as a separate procedure, etc. But since 90% of the work is identifying what and how to refactor the code not in the mechanical task of implementing the actual refactoring, the benefit of using an IDE are not huge-- it's often just as easy to cut and paste in your favorite text editor.