I am using PL/SQL in Toad for Oracle. I would like to use define a variable in my code and then using this variable multiple times in the query.
Please note that I'm not asking for the pop-up window in which input the value of the variable; I need something like this:
DEFINE min_salary = 100
SELECT Surname FROM employees
WHERE salary < min_salary
I.e. min_salary in the WHERE statement assumes the value defined above.
Surfing the net, someone suggests to add an & before the variable in the where statement, i.e.
DEFINE min_salary = 100
SELECT Surname FROM employees
WHERE salary < &min_salary
But this is not useful in my case, since the & calls the pop-up window. Instead, I would insert the value directly in the code.
Anyone could help?