Reputation: 23206
The following program produces some syntax error on line 15th. I do not understand the reason for the error.
declare
value_1 INTEGER(5);
value_2 INTEGER(5);
value_3 INTEGER(5);
value_4 INTEGER(5);
begin
value_1 := 20;
value_2 := 40;
value_3 := 60;
value_4 := 80;
if value_1 > value_2
then
dbms_output.put_line('Value_1 > Value_2');
end if;
elsif value_4 > value_3 # statement 15
then
dbms_output.put_line('Value_4 > Value_3');
end if;
end;
The error that gets thrown :
Error report:
ORA-06550: line 15, column 9:
PLS-00103: Encountered the symbol "VALUE_4" when expecting one of the following:
:= . ( @ % ;
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
Error starting at line 1 in command:
declare
value_1 INTEGER(5);
value_2 INTEGER(5);
value_3 INTEGER(5);
value_4 INTEGER(5);
begin
value_1 := 20;
value_2 := 40;
value_3 := 60;
value_4 := 80;
if value_1 > value_2
then
dbms_output.put_line('Value_1 > Value_2');
end if;
elsif value_4>value_3
then
dbms_output.put_line('Value_4 > Value_3');
end if;
end;
Error report:
ORA-06550: line 15, column 9:
PLS-00103: Encountered the symbol "VALUE_4" when expecting one of the following:
:= . ( @ % ;
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
What error is it ? How do I get rid of this error ?
Upvotes: 1
Views: 112
Reputation: 58431
The only issue with your statement I can see is the extra end if;
SQL Statement
declare
value_1 INTEGER(5);
value_2 INTEGER(5);
value_3 INTEGER(5);
value_4 INTEGER(5);
begin
value_1 := 20;
value_2 := 40;
value_3 := 60;
value_4 := 80;
if (value_1 > value_2) then
dbms_output.put_line('Value_1 > Value_2');
elsif (value_4 > value_3) then
dbms_output.put_line('Value_4 > Value_3');
end if;
end;
Upvotes: 1
Reputation: 2264
it is working man...'m i right?
declare
value_1 INTEGER(5);
value_2 INTEGER(5);
value_3 INTEGER(5);
value_4 INTEGER(5);
begin
value_1 := 20;
value_2 := 40;
value_3 := 60;
value_4 := 80;
if (value_1 > value_2)
then
dbms_output.put_line('Value_1 > Value_2');
elsif (value_4 > value_3)
then
dbms_output.put_line('Value_4 > Value_3');
end if;
end;
/
you have closed the if statement and again open elsif statement..i think this is the mistake.
Upvotes: 0