Home

Positional and named arguments should not be mixed in invocations

Rule description

  • Positional and named arguments should not be mixed in invocations

 

Non-compliant Code Example

CREATE PROCEDURE GetTotalExpense(invoice_amount1 NUMBER,invoice_amount2 NUMBER)
As
BEGIN
	DBMS_OUTPUT.PUT('Total expense amount is'|| (invoice_amount1 + invoice_amount2));
END;

BEGIN
	GetTotalExpense(1520,invoice_amount2=>633); --Non compliant code (Positional and named arguments are mixed in the invocations)
	GetTotalExpense(invoice_amount1=>1520,633); --Non compliant code (Positional and named arguments are mixed in the invocations)
END;

Compliant Code Example

CREATE PROCEDURE GetTotalExpense(invoice_amount1 NUMBER,invoice_amount2 NUMBER)
As
BEGIN
	DBMS_OUTPUT.PUT('Total expense amount is'|| (invoice_amount1 + invoice_amount2));
END;

BEGIN
	GetTotalExpense(1520,633);
	GetTotalExpense(invoice_amount1=>1520,invoice_amount2=>633); --Compliant code (Positional and named arguments are separates in invocations)
END;
Visual Expert 2020
 VEPLSQLRULE29