Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Location
    Munich, Germany
    Posts
    35

    Unanswered: Problem creating trigger in SQLPLus script file

    Hi everyone,

    I am using SQLPlus to create sequences and triggers. I am using a script file which will basically create them as I have to replicate this process many times.

    Here is the syntax I use. It creates the sequence but the create trigger command never seems to execute.

    Here is what I did:
    ----------------------------------------------------------
    CONNECT QQRSEAQ/AQUAMANAGE@SEAQT_TDBHA42
    spool c:\output.txt;

    CREATE SEQUENCE S_AKTIONEN_T START WITH 1 INCREMENT BY 1;

    CREATE OR REPLACE TRIGGER TR_AKTIONEN_T before insert for each row;
    begin
    SELECT SEQUENCE S_AKTIONEN_T.nextval INTO omwb_emulation.globalPkg.identity FROM dual;
    :new.AKTIONID := omwb_emulation.globalPkg.identity;
    end;
    spool off;
    exit
    ----------------------------------------------------------------

    Could it be because of the semi colons or something like that? It just halts after creating the sequenceand waits for user input.

    I would be grateful if someone can shed some light onto this.

    Thanks,
    Pankaj

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Try to add a slash (/) after "end;" while creating a trigger. That is:
    CREATE OR REPLACE TRIGGER
    ...
    END;
    /
    spool off;
    ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •