1 Reply Latest reply on Dec 23, 2016 4:25 PM by rp0428

    Preferences question - Code Editor

    Flofe

      Hi team,

       

      please explain preference "Code Editor" > "Link Stored Procedures to Files" (checked) to me. I don't get it. My questions:

       

      • Is this preference only for Stored Procedures/Function or for Packages, Triggers and Types as well?
      • What is the effect? Please explain it by a simple example with screenshots.
      • Which requirements have to be met to bring it to work (e.g. filename, filename-extension)

       

      Please don't refer to SQL Developer Help Center. The description there unfortunately did not help me.

       

      In Help Center is said "This setting is of interest to users who keep their PL/SQL code in a source control system.". If "Link Stored Procedures to Files" would mean changes in Procedures/Functions/Packages/Triggers/Types are directly reflected in files on file-system, then I could agree. But it seems to be something else.

       

      Regards.

        • 1. Re: Preferences question - Code Editor

          Please don't refer to SQL Developer Help Center. The description there unfortunately did not help me.

           

          Sorry - but the documentation is ALWAYS the place to start.

           

          Maybe it didn't help you but others need to know about it. And what you posted is just PART of what the doc says

          If "Link Stored Procedures to Files" would mean changes in Procedures/Functions/Packages/Triggers/Types are directly reflected in files on file-system, then I could agree. But it seems to be something else.

          What is the 'something else' you think it means? Please explain.

           

          Did you read the part above that quote where it said this:

          SQL Developer Concepts and Usage

          Link Stored Procedures to Files: If this option is enabled (checked), then every time you compile a file-based PL/SQL module, SQL Developer associates the database source with the file-based one. Subsequently, during a debugging session, whenever a reference to a PL/SQL module is made, SQL Developer checks its internal database and file-based source associations; and if it is able to find a file-based source with the specified name, it opens it. This setting is of interest to users who keep their PL/SQL code in a source control system.

           

          If this option is disabled, then during a debugging session SQL Developer always opens the procedure residing in the database, and does not check the file system.

          Did you read and understand that last paragraph?

           

          Developers often use (and should use) version control systems for their code. They check the code out and then have a copy on their machine.

           

          As the doc quote says the option will cause Sql Dev to check for files on their machine when they edit/compile pl/sql code. If disabled then it will NOT check and will just use the code in the DB.

           

          A user may have code on their machine that should NOT be used by sql dev so would NOT want the option enabled. Enabling the option could cause their local copy of the code to replace the real code version from the database. That can have BAD results.

           

          The BEST, and FASTEST way to get an answer to a 'what happens if I do this' is to just DO THAT and see what happens.

           

          Try it yourself - what happened?