2011-01-24 10 views
0

>プロンプトOracleの11グラム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; 

示唆してください。

おかげ

Kaushal

+0

クエリを再フォーマットできますか?コードを選択し、 "コード"ボタンを押して読みやすくするようにしてください。 – FrustratedWithFormsDesigner

答えて

1
  1. は "my_query.sql" という名前のファイルにクエリを保存します。
  2. 実行コマンドプロンプト(DOS、Linuxシェル、何でも...)。
  3. スクリプトがあるディレクトリに移動します(cdコマンドを使用している可能性があります)。
  4. Oracle sqlplusコマンドを実行してデータベースに接続します。
  5. クエリファイルを実行するには、コマンド@my_query.sqlを実行します。
+0

後a.queuetype = 4 とa.queueidがt_custlevel Bのa.subccno = b.subccno及びAからb.id選択しない(で をt_monitor_systemalertcfg削除 を開始t_custlevel に削除TRIGGER "ICD" .TR_DEL_SYSTEMALERTCFG_CSTLVLをCREATE .vdn = b.vdn) end TR_DEL_SYSTEMALERTCFG_CSTLVL 私は上記のクエリをmy_query.sqlに保存しましたが、sql> @/root/sesl/my_query.sqlは終了しませんでした。 –

+1

@ Kaushal Shriyan:何が存在しなかったのですか?返されたメッセージは何ですか? – FrustratedWithFormsDesigner

0

あなたが自動に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終了し、終了時にスラッシュを入れて:あなたは、rootとして、データベース・サーバー上のSQLPLUSを実行していない、あなたは?

関連する問題