oracle-databaseplsqloracle-sqldeveloper

Is it possible to comment out blocks of code that contain comments?


Say I have code like this

some_line_of_code
some_line_of_code
/* some comment about code */
some_line_of_code
some_line_of_code

and i would like to comment out a whole block like this

/*
    some_line_of_code
    some_line_of_code
    /* some comment about code */
    some_line_of_code
    some_line_of_code
*/

As you can see even SO code parser will not consider last 2 lines of code comments. Is it possible to comment out blocks of code that contain comments?

edit : To clarify, I need this to be able to comment out large sections of code to check if a function I changed can compile in a package that otherwise can't be compiled until all changes have been done.


Solution

  • In SQL Developer, I highlight all lines of PL/SQL that I want commented and use Ctrl + /.

    Obviously, you would like a way to comment and uncomment multiple lines quickly. This will put -- in front of each line you have highlighted. Do the same command to uncomment.