Some programming tools like C# or Java can mark procedures/functions as deprecated. But Oracle PLSQL is no built in functionality for this. I wonder there is another way to support this feature.
I want them to show like "The PL/SQL compiler warnings about any PL/SQL code being compiled.".
96/43 PLW-06005: inlining of call of procedure 'TEST' was done
When the EXIT statement is encountered inside a loop, the loop is immediately terminated and the program control resumes at the next statement following the loop.
It means not equal to.
The answer is that PL/SQL is not growing, but not going away either. Because it is used in the Oracle database, and the Oracle database is a fixture of enterprise systems world-wide, it will outlive you. High-performance batch processing has to happen close to the data, so PL/SQL will continue to rule in this area.
Answer: To prevent the PLSQL code from dropping to the exception code when a record is not found, you'll have to perform a count first to determine the number of records that will be returned. For example: -- Check to make sure that at least one record is returned SELECT COUNT(1) INTO v_count FROM sales.
In Oracle release 12.2, there is a new pragma
for this:
pragma deprecate ( deprecated_thing, 'Message to other developers' );
... where deprecated_thing
is any PL/SQL identifier. The following things can be deprecated:
For example:
CREATE OR REPLACE PACKAGE old_package AS
PRAGMA DEPRECATE(old_package , ’Package old_package has been deprecated in favor of new_package’);
PROCEDURE p1;
PROCEDURE p2;
END old_package;
Anyone trying to compile something that uses whatever you've deprecated will receive a PL/SQL warning in the range of PLW-6019 to PLW-6022.
You can enable these warnings as follows, so that you will see them when you try to compile code:
alter session set plsql_warnings = 'enable:(6019,6020,6021,6022)';
Alternatively, you can set your session to treat these warnings as errors:
alter session set plsql_warnings = 'error:6020';
Or, you can set the object itself to make anyone using it to get an error:
alter package <package with deprecated stuff> compile plsql_warnings = 'error:6020' reuse settings;
This is not a supported function of Oracle and the PL/SQL language. You would have to develop a sort of framework that would check variables at the beginning of execution to determine if the code was depreciated however that would all have to be manually handled by development team. This simply is not a feature yet included by Oracle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With