1 PLS-00363 expression A cannot be used as an assignment targetoracle
The error "PLS-00363: expression 'A' cannot be used as an assignment target" in Oracle indicates that you are trying to assign a value to an expression that cannot be assigned.
In Oracle PL/SQL, an assignment target can be a variable, a record, an element of an array, or an attribute of an object. However, it cannot be a constant or a literal value.
To resolve this error, you need to make sure that the assignment target is a valid variable, record, array element, or object attribute. Double-check the expression you are trying to assign a value to and ensure that it is a valid assignment target.
Here's an example of the error and its resolution:
DECLARE
A CONSTANT NUMBER := 10;
BEGIN
A := 20; -- This will result in PLS-00363 error
END;
To fix the error, you can declare a variable and assign the constant value to it:
DECLARE
A CONSTANT NUMBER := 10;
B NUMBER;
BEGIN
B := A; -- Assign the constant value to a variable
DBMS_OUTPUT.PUT_LINE(B); -- Output: 10
END;
In this example, the constant value 'A' is assigned to the variable 'B', which is a valid assignment target
原文地址: http://www.cveoy.top/t/topic/hZG6 著作权归作者所有。请勿转载和采集!