Reputation: 447
How do I enter a substitution variable such that it can be used multiple times throughout a SQL statement?
For example
SELECT '&X','&X',A <--SEES X AS TWO DIFFERENT VARIABLES
FROM T;
Sees each X
as a different variable. How can I make it such that X
is only one variable?
Upvotes: 2
Views: 1261
Reputation: 10360
If you mean you are prompted twice for a value for the same variable, use 2 ampersands instead of one for a permanent substitution variable instead of a temporary substitution variable. Here's an explanation of the difference: What is the difference between & and &&?
Upvotes: 5