Votes

Improve compile-time warnings (details)
 
Dear Bryn,

I love PL/SQL and the new compilation warnings.

Could you please add warnings for the following:

• var VARCHAR2(1) := 'abc';
• variables declared and not used

Thanks so much!



Oracle introduced compile-time warnings in Oracle Database 10g. With warnings enabled, for example, the compiler will now tell me if there are lines of code that are unreachable - will never be run.

Yet the compiler does not warn us about some of the most common problems we may encounter, namely:

** I declare a variable or pass an argument that is not used at all in my program.

** I declare a string, maximum length N, and assign it a default value with more than N characters.


Add more rules to the compile-time warning framework. Think about all the warnings the PL/SQL development team gets from their OWN compilers as they write the code that implements PL/SQL. Which do you find most useful? Implement those!


CREATE OR REPLACE PROCEDURE abc
IS
   l_string VARCHAR2(5) := 'Steven';
BEGIN
   NULL;
END;


Not applicable.


Steven Feuerstein, PL/SQL Evangelist, Quest Software: "Help me help Oracle improve the PL/SQL language!"


Bryn Llewellyn: "We love to hear from PL/SQL developers. Let us know what is important to you!"

PL/SQL Obsession
Apex Evangelists
O'Reilly Books on Oracle
OTN PL/SQL Best Practices
OTN PL/SQL Page
Steven Feuerstein's Blog