ORA-00933: SQL command not properly ended? Enter Bind Variables?
<p>I am attempting to write out in my SQL commands for Oracle Apex 5, and I cannot see why I'm getting an error. Also, a popup window appears once I submit asking to <code>'Enter Bind Variables'</code> for '<code>:NEW'</code>? Isn't it already declared?</p>

<pre><code>drop table tmpcapacityguide cascade constraints;
drop table tmpcaravanpark cascade constraints;

create table tmpcaravanpark as select * from Caravan_park;
create table tmpcapacityguide 
(mincap   number(3),
 maxcap   number(3));

insert into tmpcapacityguide values(30, 150);

CREATE OR REPLACE TRIGGER "PARK_CAPACITY_CHECK" 
before insert or update of capacity
on Caravan_park
for each row
when (:new.capacity &lt; 30) DECLARE
mincapacity integer;
maxcapacity integer;

begin
select mincap, maxcap
into mincapacity, maxcapacity
from tmpcapacityguide
where capacity = :new.capacity;
if (new.capacity &lt; mincapacity)
then raise_application_error(-20601, 'Capacity must be between 30 and 150');
end if;
end;
</code></pre>