My Oracle Support Banner

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 and later
Information in this document applies to any platform.


In this sample, there are two variables 'a1' and 'a2'.
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.

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

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.