Home

DBMS_OUTPUT.PUT_LINE should not be used

Description

    The DBMS_OUTPUT.PUT_LINE should not be used rule states that the DBMS_OUTPUT.PUT_LINE command should not be used in PL/SQL code. This command is used to display output from PL/SQL code, but it is not recommended for production code due to its limited capabilities and lack of scalability. Instead, it is recommended to use other methods such as writing to a log file or displaying output in a web page.

Key Benefits

  • No Debugging: DBMS_OUTPUT.PUT_LINE should not be used as it does not provide debugging capabilities.
  • No Security: DBMS_OUTPUT.PUT_LINE should not be used as it does not provide any security.
  • No Performance: DBMS_OUTPUT.PUT_LINE should not be used as it does not provide any performance benefits.
  • No Scalability: DBMS_OUTPUT.PUT_LINE should not be used as it does not provide scalability.

 

Non-compliant Code Example

BEGIN
 IF score > 35 AND score < 50  THEN 
		IF score > 50 AND score < 70 THEN 
				IF score > 70 THEN 
					DBMS_OUTPUT.PUT_LINE('Grade A');  --Non compliant code (DBMS_OUTPUT.PUT_LINE is used)
				END IF;
			DBMS_OUTPUT.PUT('Grade B'); --Non compliant code (DBMS_OUTPUT.PUT is used)
		END IF;
	DBMS_OUTPUT.PUT('Grade C'); --Non compliant code (DBMS_OUTPUT.PUT is used)
 END IF;
END;
Visual Expert 2024
 VEPLSQLRULE140