Reputation:
How do i run the below query inside sql > prompt in Oracle 11g R2 SE
CREATE TRIGGER "ICD".TR_DEL_SYSTEMALERTCFG_CSTLVL
after delete on t_custlevel
begin
delete t_monitor_systemalertcfg a
where a.queuetype = 4
and a.queueid not in (
select b.id from t_custlevel b
where a.subccno = b.subccno
and a.vdn = b.vdn
);
end TR_DEL_SYSTEMALERTCFG_CSTLVL;
Please suggest.
Thanks
Kaushal
Upvotes: 0
Views: 1434
Reputation: 8915
Put a slash at the end and exit if you automaticly want to exit sql
CREATE TRIGGER "ICD".TR_DEL_SYSTEMALERTCFG_CSTLVL
after delete on t_custlevel
begin
delete t_monitor_systemalertcfg a
where a.queuetype = 4
and a.queueid not in (
select b.id from t_custlevel b
where a.subccno = b.subccno
and a.vdn = b.vdn
);
end TR_DEL_SYSTEMALERTCFG_CSTLVL;
/
exit
BTW : your are not running sqlplus on the database server as root, are you?
Upvotes: 0
Reputation: 27536
cd
command, probably).sqlplus
command to connect to database.@my_query.sql
to execute the query file.Upvotes: 1