Home
Deprecated LONG and LONG RAW datatypes should no longer be used
Description
The rule "Deprecated LONG and LONG RAW datatypes should no longer be used" states that the LONG and LONG RAW datatypes, which are deprecated, should not be used in PL/SQL code. These datatypes have been superseded by other datatypes, such as CLOB and BLOB, which are more efficient and provide better performance. Therefore, it is recommended that developers use the newer datatypes instead of the deprecated LONG and LONG RAW datatypes.
Key Benefits
- More Secure and Reliable: This rule helps to ensure that the database is more secure and reliable, as these datatypes are outdated and can cause issues with performance and stability.
- Increased performance: By avoiding the use of these datatypes, the database can run more efficiently and quickly, resulting in improved performance.
- Improved stability: By avoiding the use of these datatypes, the database can be more stable and reliable, as the risk of errors and crashes is reduced.
- Enhanced security: By avoiding the use of these datatypes, the database can be more secure, as the risk of malicious attacks is reduced.
Non-compliant Code Example
Create TABLE EMPLOYEE
(
EMP_ID number(10) NOT NULL,
FIRSTNAME NVARCHAR2(75),
LASTNAME NVARCHAR2(75),
DEPT_ID int,
ADDRESS NOT NULL,
Landmark LONG RAW, --Non compliant code (Column is of type Long Raw)
Photo blob(),
CONSTRAINT pk_employee PRIMARY KEY (EMP_ID)
);
Compliant Code Example
Create TABLE EMPLOYEE
(
EMP_ID number(10) NOT NULL,
FIRSTNAME NVARCHAR2(75),
LASTNAME NVARCHAR2(75),
DEPT_ID int,
ADDRESS NOT NULL,
Landmark BLOB, --Compliant code
Photo blob(),
CONSTRAINT pk_employee PRIMARY KEY (EMP_ID)
);