Concatenating Strings Results In Value Treated as a Literal Instead of a Variable.
(Doc ID 1083793.1)
Last updated on DECEMBER 02, 2019
Applies to:PL/SQL - Version 10.2.0.4 and later
Information in this document applies to any platform.
The objective is to be able to pass in either a 1 or a 2 so that within the DBMS_OUTPUT.PUT_LINE call, either variable a1 or a2 will be displayed.
Instead, the variable is being treated like a literal 'a1' or 'a2' but the goal is to concatenate to build a variable then get its value.
create or replace procedure new_test (p1 number) is
a1 number := 22;
a2 varchar2(20) := 'Test';
SQL> execute new_test(1);
Notice that the literal 'a1' is displayed instead of the 22 which is the value stored in the a1 variable.
SQL> execute new_test(2);
Notice that the literal 'a2' is displayed instead of the value 'Test' which is the value stored in the a2 variable.
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document