Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.4K Intelligent Advisor
- 75 Insurance
- 537.7K On-Premises Infrastructure
- 138.7K Analytics Software
- 38.6K Application Development Software
- 6.1K Cloud Platform
- 109.6K Database Software
- 17.6K Enterprise Manager
- 8.8K Hardware
- 71.3K Infrastructure Software
- 105.4K Integration
- 41.6K Security Software
*_SOURCE metadata views to indicate comments in the text field
Hi all,
Just a thought if Oracle can provide an additional column in *_source metadata views to indicate if that particular line is a comment or not..
e.g.:
As you see below the string "Can this be ......." is within enclosed comments. Would it be better to show that this is commented line..
Some check flag like this if provided by oracle it would be very easy to filter out those lines which we search for some string within code base.
Comments welcome!
Cheers,
Manik.
Comments
-
A lot of lines will be part comment, so I'm not sure this will be very useful. If you are searching source code for references to
chk_this
excluding comment lines, you will still find it innew_thing(); <em>-- Similar to chk_this but for bananas</em>
and so on.
-
A lot of lines will be part comment, so I'm not sure this will be very useful. If you are searching source code for references to
chk_this
excluding comment lines, you will still find it innew_thing(); <em>-- Similar to chk_this but for bananas</em>
and so on.
Hi., firstly thanks for your comment. I agree that there are lot of possibilities to present the comment situations.
One of the other possibilities can be as depicted below as well.
My intention is just to start something in the lines of classifying commented text. where its a "complete" comment. like the one stated in the original question.
May be oracle can convert your example as : (observe line number does not add up because of the comment.)
Line number text Comment_flag
10 new_thing(); 'N'
<em>-10 -- Similar to chk_this but for bananas 'Y'</em>
------------------------------------------
And second example may be transformed as:
-------------------------------
Line Number text comment_flag
10 begin 'N'
11 new_thing(a,b 'N'
-11 /* this is optional parameter */ 'Y'
11 ,c); 'N'
12 end; 'N'
Again this is just a thought.. Comments welcome !
Cheers,
Manik.
-
Hi., firstly thanks for your comment. I agree that there are lot of possibilities to present the comment situations.
One of the other possibilities can be as depicted below as well.
My intention is just to start something in the lines of classifying commented text. where its a "complete" comment. like the one stated in the original question.
May be oracle can convert your example as : (observe line number does not add up because of the comment.)
Line number text Comment_flag
10 new_thing(); 'N'
<em>-10 -- Similar to chk_this but for bananas 'Y'</em>
------------------------------------------
And second example may be transformed as:
-------------------------------
Line Number text comment_flag
10 begin 'N'
11 new_thing(a,b 'N'
-11 /* this is optional parameter */ 'Y'
11 ,c); 'N'
12 end; 'N'
Again this is just a thought.. Comments welcome !
Cheers,
Manik.
I'm still not understanding why you want to know if LINE 5 is a comment line or not.
Personally, I would prefer some way (dbms package? XML_COMMENTS field? ) to extract the PL/Doc style comments so I can create something with that information.
I feel that knowing "Line 5 is a comment" is useless.
Knowing the PL/Doc comment for "function LETS_KILL_THE_DBA return int" states that the function "orders a pizza using the DBA's CC" would be more useful.
MK
-
I think that if you select * from all_source where lower(text) like '%x_type%' you would like to know if that x_type does not happen to be found in a comment and is actually used by the procedure. Isn't that it? Kind-of eliminating dead code and finding where some object is referenced in code.
-
I think that if you select * from all_source where lower(text) like '%x_type%' you would like to know if that x_type does not happen to be found in a comment and is actually used by the procedure. Isn't that it? Kind-of eliminating dead code and finding where some object is referenced in code.
Unfortunately the whole thing is made into lower or upper like this :
Cheers,
Manik.
-
Pondering deeper on the subject, I think this is the most difficult way to put things. So, to see if that is part of a comment or not, that would mean loading the whole stored program unit in memory and having it compiled and also having somehow indications that a referred object is found on certain lines.
A better way to put it would be: if there could be some say pipelined function that would return all the program units that refer some database object or stored program (like refer a package or type or package.procedure or type.method or type.attribute).
Wouldn't this look like being more feasible?
And things get really tricky if some program units contain dynamic SQL. Then, it would be even more difficult to determine where some object is referred. I don't think there would be a complete solution to this kind of problem and I guess using dba_dependencies will have to suffice for quite a long time.