5 Replies Latest reply on Jan 10, 2014 2:48 PM by Arpod

    Bug in SQLDeveloper 4.0 database copy: terminator symbol

    Arpod

      Greetings.

       

      When copying database packages from one connection to another, terminator symbol ('/') sometimes gets appended right after "END;", without any preceding newlines. Because of that, terminator symbol ends up being the last symbol in the created package spec and/or body, thus preventing it from compiling.

       

      Database export to worksheet and compiling on another connection could be used as a workaround, but a working "copy" option still wouldn't hurt.

        • 1. Re: Bug in SQLDeveloper 4.0 database copy: terminator symbol
          Kuzhao-Oracle

          Sorry, I checked and couldn't reproduce it in released build 4.0.0.13.80. After using database copy packages, all are copied fine and terminator symbol ("/") will be in next newline after "END;" in copy log. And open the copied packages, they are same like the source packages. Could you provide more info, e.g.build version, or some special setting? Thanks.

          • 2. Re: Bug in SQLDeveloper 4.0 database copy: terminator symbol
            Arpod

            Thank you for your reply. I figured out the steps to reproduce that bug - the cause is trailing whitespace in the last line of package

             

            Go to worksheet and execute the following statement:

            create or replace PACKAGE TEST_PACK is
            
            END TEST_PACK;
            

             

            Notes:

            • There should be a trailing space character(s) after "END TEST_PACK;" line;
            • "END TEST_PACK;" should be the last line
            • the statement must be executed from worksheet, as package editor seems to trim the trailing whitespace upon compilation.

             

            Now just select "Database Copy" and copy the "TEST_PACK"  package. I got the following result:

             

            --- START --------------------------------------------------------------------
              DROP PACKAGE "TEST_PACK";
            
            
            package "TEST_PACK" dropped.
            
            --- END --------------------------------------------------------------------
            --- START --------------------------------------------------------------------
            --- END --------------------------------------------------------------------
            --- START --------------------------------------------------------------------
            --- END --------------------------------------------------------------------
            --- START --------------------------------------------------------------------
            set define off;
            
            --------------------------------------------------------
            -- DDL for Package TEST_PACK
            --------------------------------------------------------
            
              CREATE OR REPLACE PACKAGE "TEST_PACK" is
            
            END TEST_PACK; /
            
            PACKAGE TEST_PACK compiled
            Errors: check compiler log
            
            --- END --------------------------------------------------------------------
            
            

             

            As you can see, terminator character('/') got appended right after 'END TEST_PACK; ', which caused compilation error.

            • 3. Re: Bug in SQLDeveloper 4.0 database copy: terminator symbol
              Kuzhao-Oracle

              Thanks for your reproduce steps. Yes, I can see your issue. But I followed your steps and still couldn't reproduce. Sorry, I think maybe there is something else wrong. Please clarify me if I misunderstand the steps. Thanks.

              Using released build 4.0.0.13.80 with JDK 1.7.0_45 (64bit) on Win7. Steps:

              • Run below statement in CopySrc worksheet (Including a trailing space character after 'END TEST_PACK;' and make sure it is the last line)

              create or replace PACKAGE TEST_PACK is

              END TEST_PACK;

              • Open just created TEST_PACK package, use mouse to select all the code and we can find the code with white space. (Don't compile or run, only just view)
              • Then using "Database Copy" to copy the "TEST_PACK"  package to destination connection CopyDes. I got result as

              --- START --------------------------------------------------------------------

              set define off;

               

              --------------------------------------------------------

              --  DDL for Package TEST_PACK

              --------------------------------------------------------

               

                CREATE OR REPLACE PACKAGE "TEST_PACK" is

              END TEST_PACK;

              /

               

              PACKAGE TEST_PACK compiled

               

              --- END ----------------------------------------------------

              • Check the package in CopyDes. It is there and the code with white space.
              • 4. Re: Bug in SQLDeveloper 4.0 database copy: terminator symbol
                dz_r

                Hi,

                 

                When the source database is 10g (10.2.0.4.0) I'm experiencing the same problem as Arpod.

                 

                When the source database is 11g (11.2.0.1.0) there is no problem.

                • 5. Re: Bug in SQLDeveloper 4.0 database copy: terminator symbol
                  Arpod

                  Hello.

                  Thanks for clarification. I also work in 10g - it's probably a db-version-specific bug.