|
-
sql statement
Hi,
I have this code which in SQL*Plus runs ok but in PL/SQL it doesn't.
How can I come around with it?
SQL*PLUS
--------
delete from tblworkingcontent
where idworkingcontent in
(select idworkingcontent
from tblworkingcontent wc1
where wc1.metatags='a'
and (select count(*)
from tblworkingcontent wc2
where wc2.idworkingcontent
and wc2.metatags='a') <
(select count(*)
from tblworkingcontent wc3
where wc3.metatags='a'-1))
In PL/SQL instead it doesn't execute
declare
v_metatags tblworkingcontent.metatags%type;
v_numerorighe int;
begin
delete from tblworkingcontent
where idworkingcontent in
(select idworkingcontent
from tblworkingcontent wc1
where wc1.metatags=v_metatags
and (select count(*)
from tblworkingcontent wc2
where wc2.idworkingcontent
and wc2.metatags=v_metatags) <
(select count(*)
from tblworkingcontent wc3
where wc3.metatags=v_metatags-v_numerorighe))
end;
/
ERROR at line 10:
ORA-06550: line 10, column 14:
PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + mod not null others
avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
ORA-06550: line 13, column 46:
PLS-00103: Encountered the symbol "<" when expecting one of the following:
) with and or group having intersect minus start union where
connect
ORA-06550: line 16, column 62:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
; return returning and or
Thank you in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|