Use the following code, that is not really doing something and won’t execute but it is to demonstrate the problem I’ve found:
DECLARE
c_x CONSTANT VARCHAR2(20) := ‘X’;
BEGIN
SELECT *
FROM DUAL
WHERE dummy = c_x;
END;
If you go to the select and do an Ctrl-Enter for executing the select, you get a popup with
SELECT *
FROM DUAL
WHERE dummy = :C_X
Clikc OK and you get the variables popup as below. The problem is that the quotes are picked up from the constant declaration, so if you execute directly, you get no records, while you would expect one. So every time I test my query I must remove first all the quotes on the varchar2 constants…
Thread created by wimdelange_062
Use the following code, that is not really doing something and won't execute but it is to demonstrate the problem I've found:
DECLARE
c_x CONSTANT VARCHAR2(20) := 'X';
BEGIN
SELECT *
FROM DUAL
WHERE dummy = c_x;
END;
If you go to the select and do an Ctrl-Enter for executing the select, you get a popup with
SELECT *
FROM DUAL
WHERE dummy = :C_X
Clikc OK and you get the variables popup as below. The problem is that the quotes are picked up from the constant declaration, so if you execute directly, you get no records, while you would expect one. So every time I test my query I must remove first
all the quotes on the varchar2 constants....