I have pl/sql anonymous block like below
declare
v_count pls_integer := 0;
begin
select count(1) from product_component_version
into v_count
where product like '%Enterprise%';
if v_count = 0 then
raise program_error;
end if;
exception
when program_error then
raise_application_error (-20001, 'This is valid for Oracle Enterprise Edition only!');
end;
When I try to execute the above,I am getting the below error
ORA-06550: line 5, column 5:
PL/SQL: ORA-00933: SQL command not properly ended
Which is nothing but for “into v_count” statement.
As per my understanding the syntax is wrong and when I changed that statemnt like below it is working fine.
select count(1) into v_count
from product_component_version
where product like '%Enterprise%';
I have tested this in “Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit”.
But the original script is available in all our older versions of our product.
I would like to know the syntax in original script is supported in older oracle versions?
Or can you please let me know any information on this which can answer my confusion?
Thanks,
Vijay
With a test block:
In Oracle 9iR2 (9.2.0.8 on Solaris), 10gR2 (10.2.0.5 on Solaris) and 11gR2 (11.2.0.3 on Linux) I get exactly the same error:
I don’t believe it has ever been supported the way you had it, though I don’t have an 8i or earlier database to test against.
You said ‘the original script is available in all our older versions of our product’, but would it actually ever have been run, and if so can you identify an exact version it didn’t raise an error against?