Replace variables with bound variables:
sql> define x= ' abc '--Defining variables
Sql> define X
DEFINE X = "abc" (CHAR)
sql> select ' &x ' from dual; --Query substitution variable value
Old 1:select ' &x ' from dual
New 1:select ' abc ' from dual
' AB
---
Abc
sql> variable x varchar2 (10)--Declaring variables
Sql> begin
2:x: = ' Hello ';
3 END;
4/
PL/SQL procedure successfully completed.
Sql> print:x--Print bound variable values
X
--------------------------------
Hello
Sql> select:x, ' &x ' from dual; --Query bound variable and substitution variable value
Old 1:select:x, ' &x ' from dual
New 1:select:x, ' abc ' from dual
: X ' AB
-------------------------------- ---
Hello ABC
Note: Define variables are always sql*plus extended strings, and the declare variable can be used by SQL and PL $ as a true binding variable.
This article from "Technology Station" blog, declined reprint!
ORACLE PL/SQL Exercise (eight)