开发者

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


  1. Save your query to a file named "my_query.sql".
  2. run command prompt (DOS, linux shell, whatever...).
  3. navigate to directory where your script is (using the cd command, probably).
  4. Run the Oracle sqlplus command to connect to database.
  5. 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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜