Print Thread
Nested Comments Faulty
#64291 10/27/22 02:55 PM
Joined: Apr 2020
Posts: 92
Z
zakko Offline OP
Member
OP Offline
Member
Z
Joined: Apr 2020
Posts: 92
PL/SQL-Developer 15.0.2.2054 (64 bit) has issues with nested multi-line comments.

Given the following comments:

Code
/* 
  Lorem ipsum dolor sit amet, consectetur adipiscing elit,
  sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

  /* Ut enim ad minim veniam, quis nostrud exercitation ullamco
  laboris nisi ut aliquip ex ea commodo consequat.
  Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur. */

  Excepteur sint occaecat cupidatat non proident, sunt in culpa
  qui officia deserunt mollit anim id est laborum.
*/

The lines starting at "Excepteur..." would not be commented out in PL/SQL-Developer.

Last edited by zakko; 10/27/22 02:58 PM.
Re: Nested Comments Faulty
zakko #64292 10/28/22 09:02 AM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
We'll check it out.


Marco Kalter
Allround Automations
Re: Nested Comments Faulty
zakko #64294 10/29/22 10:44 AM
Joined: Oct 2022
Posts: 3
J
Member
Offline
Member
J
Joined: Oct 2022
Posts: 3
In face , It's not support in sqlplus environment . So I guess comment of "/* */" format could not be nested .

Re: Nested Comments Faulty
zakko #64300 11/02/22 01:03 PM
Joined: Apr 2020
Posts: 92
Z
zakko Offline OP
Member
OP Offline
Member
Z
Joined: Apr 2020
Posts: 92
True, it looks like according to Oracle nested multiline comments should throw a syntax error:
https://docs.oracle.com/en/database...UID-2722A49F-C233-4DDF-B236-10EE3DD6B79B

But personally I do not get what's the reason for that limitation by Orcale.

Re: Nested Comments Faulty
zakko #64301 11/02/22 01:32 PM
Joined: Jan 2006
Posts: 39
J
Member
Offline
Member
J
Joined: Jan 2006
Posts: 39
When the first /* is encountered, Oracle begins ignoring all subsequent text until it finds the first occurrence of */. Oracle doesn't "see" the second /* as it is within a comment, which Oracle is not syntax parsing. Once the first */ is encountered, Oracle resumes syntax checking. It runs across the second */ and given the parser is not tracking a currently open /*, it throws an error.

Their approach makes logical sense and it is what Oracle documented. You don't have to agree with it, but it's how the language works and so PSD would/should parse the data the same way and not treat the text starting with "Excepteur..." as a comment.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.031s Queries: 14 (0.009s) Memory: 2.5133 MB (Peak: 3.0380 MB) Data Comp: Off Server Time: 2024-04-29 19:42:49 UTC
Valid HTML 5 and Valid CSS