Oracle 11g R2 SE run query
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开发者_JAVA技巧
and a.vdn = b.vdn
);
end TR_DEL_SYSTEMALERTCFG_CSTLVL;
Please suggest.
Thanks
Kaushal
- Save your query to a file named "my_query.sql".
- run command prompt (DOS, linux shell, whatever...).
- navigate to directory where your script is (using the
cd
command, probably). - Run the Oracle
sqlplus
command to connect to database. - Run command
@my_query.sql
to execute the query file.
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?
精彩评论