Error in trigger

Hi,
I am stuck with the error PLS-00103.
Actually what I want to do is, I have a table user_info which holds the details about the users like passwords.
Each time a user updates a password in the table, the new password should go into the varrying array old_passwords, which is an attribute in the table. If the number of passwords are equal to the size(i.e 10) of the array then,
the new password which is being updated should be checked whether it is already there in the last 10 passwords,
if it is there then I have to raise an exception, otherwise I have to trim the last password from the array and add the new password to the first position of the array.
And for inserting the passwords I have a procedure called add_password which takes a varying object and the new password as parameters. I have written the code in order to avoid the mutating table error.
I am showing all that I have done, I wil be very thankful, if anyone can suggest me a way to solve the problem.
-- Table user_info
create table User_Info(Name varchar2(20),
Passwd varchar2(10),
E_Mail varchar2(30) constraint email_pk primary key deferrable initially immediate,
Rank varchar2(20),
Country varchar2(30) constraint user_fk references country, Passwd_Change_Date date,
Last_Login date,
Old_Passwords Old_Passwds_Ty,
constraint uname_uq unique(name));
-- package to avoid mutating table error
create or replace package new_pas as
type pwd_ty is table of user_info%rowtype index by binary_integer;
upwd_table pwd_ty;
end new_pas;
--after row level trigger to store new values
create or replace trigger b_trig
after update of passwd on user_info
for each row
begin new_pas.upwd_table(new_pas.upwd_table.count+1).passwd:=:new.passwd; new_pas.upwd_table(new_pas.upwd_table.count+1).name:=:old.name;
end b_trig;
-- after statement level trigger
create or replace trigger trig_pass after update of passwd on user_info
begin
declare old_pass old_passwds_ty;
begin select old_passwords into old_pass from user_info where name=new_pas.upwd_table(new_pas.upwd_table.count+1).name;
if old_pass is null or old_pass.count<old_pass.limit then
add_password(old_passwds_ty('some'),new_pas.upwd_table(new_pas.upwd_table.count+1).passwd);
elsif old_pass.count=old_pass.limit then
for i in 1 .. old_pass.count loop
if old_pass(i)=new_pas.upwd_table(new_pas.upwd_table.count+1).passwd then raise exceptions_package.Invalid_password;
end if;
end loop;
add_password(old_passwds_ty('some'),new_pas.upwd_table(new_pas.upwd_table.count+1).passwd);
new_pas.upwd_table.delete;
end if;
end trig_pass;
-- The error while compiling this trigger is:
37/0 PLS-00103: Encountered the symbol "end-of-file" when expecting one of the follow ing: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with ><an identifier> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe
-- The body of add_password is:
create or replace procedure Add_password(user_pwd old_passwds_ty,pwd user_info.passwd%type) is
new_pass old_passwds_ty;
u_pwd old_passwds_ty;
begin
u_pwd:=user_pwd;
for rec in (select old_passwords from user_info) loop
u_pwd:=rec.old_passwords;
if u_pwd is null then
new_pass:=old_passwds_ty(pwd);
elsif u_pwd.count=u_pwd.limit then
new_pass:=old_passwds_ty(pwd);
u_pwd.trim;
for i in 1 .. u_pwd.count loop
new_pass(i+1):=u_pwd(i);
end loop;
exit;
end if;
end loop;
update user_info set old_passwords=new_pass; end add_password;
Thanks for reading, I will be very thankful, If I can get a solution

-- after statement level trigger
create or replace trigger trig_pass after update of passwd on user_info
begin
declare old_pass old_passwds_ty;
begin select old_passwords into old_pass from user_info where name=new_pas.upwd_table(new_pas.upwd_table.count+1).name;
if old_pass is null or old_pass.count<old_pass.limit then
add_password(old_passwds_ty('some'),new_pas.upwd_table(new_pas.upwd_table.count+1).passwd);
elsif old_pass.count=old_pass.limit then
for i in 1 .. old_pass.count loop
if old_pass(i)=new_pas.upwd_table(new_pas.upwd_table.count+1).passwd then raise exceptions_package.Invalid_password;
end if;
end loop;
add_password(old_passwds_ty('some'),new_pas.upwd_table(new_pas.upwd_table.count+1).passwd);
new_pas.upwd_table.delete;
end if;
end;
end trig_pass;
Need one more end;
/

Similar Messages

  • HSDIO conditionally fetch hardware compare sample errors (script trigger to flag whether or not to wait for software trigger)

    I am moderately new to Labview and definitely new to the HSDIO platform, so my apologies if this is either impossible or silly!
    I am working on a system that consists of multiple PXI-6548 modules that are synchronized using T-CLK and I am using hardware compare.  The issue I have is that I need to be able to capture ALL the failing sample error locations from the hardware compare fetch VI... By ALL I mean potentially many, many more fails than the 4094 sample error depth present on the modules.
    My strategy has been to break up a large waveform into several subsets that are no larger than 4094 samples (to guarantee that I can't overflow the error FIFO) and then fetch the errors for each block.  After the fetch is complete I send a software reference trigger that is subsequently exported to a scriptTrigger that tells the hardware it is OK to proceed (I do this because my fetch routine is in a while loop and Labview says that the "repeated capbility has not yet been defined" if I try to use a software script trigger in a loop).
    This works fine, but it is also conceivable that I could have 0 errors in 4094 samples.  In such a case what I would like to do is to skip the fetching of the hardware compare errors (since there aren't any) and immediately begin the generation of the next block of the waveform.  That is, skip the time where I have to wait for a software trigger.
    I tried to do this by exporting the sample error event to a PFI and looping that PFI back in to generate a script trigger.  What I thought would happen was that the script trigger would get asserted (and stay asserted) if there was ever a sample error in a block, then I could clear the script trigger in my script.  However, in debug I ended up exporting this script trigger back out again and saw that it was only lasting for a few hundred nanoseconds (in a case where there was only 1 injected sample error)... The sample error event shows up as a 1-sample wide pulse.
    So, my question is this:  is there a way to set a flag to indicate that at least one sample error occurred in a given block  that will persist until I clear it in my script?  What I want to do is below...
    generate wfmA subset (0, 4094)
    if scriptTrigger1
      clear scriptTrigger1
      wait until scriptTrigger0
    end 
    clear scriptTrigger0
    generate wfmA subset (4094, 4094)
    I want scriptTrigger1 to be asserted only if there was a sample error in any block of 4094 and it needs to stay asserted until it is cleared in the script.  scriptTrigger0 is the software trigger that will be sent only if a fetch is performed.  Again, the goal being that if there were no sample errors in a block, the waiting for scriptTrigger0 will not occur.
    I am probably going about it all wrong (obviously since it doesn't work), so any help would be much appreciated!

    Please disregard most of my previous post... after some more debug work today I have been able to achieve the desired effect at slower frequencies.  I did straighten out my script too:
    generate wfmA
    if scriptTrigger1
      clear scriptTrigger0
      wait until scriptTrigger0
    end if
    generate wfmA
    scriptTrigger1 = sample error event flag
    scriptTrigger0 = software trigger (finished fetching error backlog in SW)
    However, I am still having a related issue.
    I am exporting the Sample Error Event to a PFI line, looping that back in on another PFI line, and having the incoming version of the Sample Error Event generate a script trigger.  My stimulus has a single injected sample error for debug. For additional debug I am exporting the script trigger to yet another PFI; I have the sample error event PFI and the script trigger PFI hooked up to a scope.
    If I run the sample clock rate less than ~133MHz everything works... I can see the sample error event pulse high for one clock period and the script trigger stays around until it is consumed by my script's if statement.
    Once I go faster than that I am seeing that the script trigger catches the sample error event occasionally.  The faster I go, the less often it is caught.  If I widen out the error to be 2 samples wide then it will work every time even at 200MHz.
    I have tried PFI0-3 and the PXI lines as the output terminal for the sample error event and they all have the same result (this implies the load from the scope isn't the cause).
    I don't know what else to try?  I can't over sample my waveform because I need to run a true 200MHz. I don't see anything that would give me any other control over the sample error event in terms of its pulsewidth or how to export it directly to a script trigger instead of how I'm doing it.
    Any other ideas?

  • How can i creat a trigger    error  invalid trigger specification

    i have a stored procedure which i want it to be triggered when an insertion is done on table A
    and that stored procedure accepts values from the insertion performed in table A
    and inserts into Table B by either updating the table or insertion into Table B
    how can i achieve this
    OK fine i have a table called Table A
    i want a trigger that can accept values such as
    create or replace trigger UpdateMyDoc  after insert on  Table A
    for each row
    accoutntno varchar2,
    ID varchar2
    As
    cnt number;
    Begin
    update Table B value (accoutntno ,ID ); commit;
    end ;
    is the above possible if it is then i get this  [1]: (Error): ORA-04079: invalid trigger specification
    any help
    Edited by: kama021 on Aug 13, 2009 2:24 AM

    Stop right there, Kama.
    update Table B value (accoutntno ,ID ); commit;Do not go any further on triggers, until you at least know how to write an UPDATE
    Or is it INSERT
    Once you have that in place, carry on by reading a bit about Transactions
    Regards
    Peter

  • Error in Trigger ( PL/SQL: ORA-01744: inappropriate INTO)

    Hi ,
    I've written the trigger in the following format.. As the original trigger is around 700 lines, so just format is written here.. please co-operate..
    CREATE OR REPLACE TRIGGER --
    AFTER UPDATE OF COL1
    ON TAB1
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    WHEN (NOT(OLD.COL1 IS NULL AND NEW.COL1=0))
    DECLARE
    rowToins PAK1.fdList;
    i number;
    BEGIN
    IF :NEW.COL2='V' THEN
    INSERT INTO DEST(
      D_AT)
    SELECT * FROM ( SELECT --
       PAK2.FUN1('AD',TAB10.ID) AS D_AT
    FROM ---
    WHERE --- )
       WHERE D_AT IS NOT NULL;
    ELSEIF :NEW.COL2 ='H' THEN
    SELECT * FROM ( SELECT --
       PAK2.FUN1('AD',TAB9.ID) AS D_AT
    BULK COLLECT INTO rowToins
    FROM ---
    WHERE --- )
       WHERE D_AT IS NOT NULL;
    i:=rowToins.FIRST;
    WHILE i IS NOT NULL LOOP
    --insert row 1
      PAK1.fun2(rowToins(i).<col>,
    i:=rowToins.NEXT(i);
    END LOOP;
    END IF;
    END;
    /The above code is giving the error..
    PL/SQL: ORA-01744: inappropriate INTOSo how can i correct the code...
    thanks

    The line no..are
    159/3 PL/SQL: SQL Statement ignored
    213/16 PL/SQL: ORA-01744: inappropriate INTO
    159 --> the first where condition in the example code
    213 --> the select list column in the second if condition in example code
    If i remove the
    select * from (
    PAK2.FUN1('AD',TAB9.ID) AS D_AT
    WHERE D_AT IS NOT NULL;Then the trigger is created with no issues....
    please let me know if i'm not clear
    Edited by: josh1612 on Apr 27, 2009 3:42 AM

  • Error On trigger while adding a date

    This is my trigger i want to add 15 dates to issue date,while running a trigger its showing error,
    try to solve that trigger
    create or replace
    TRIGGER ISSUE_BOOK_TRI
    BEFORE
    INSERT ON issue_book FOR EACH ROW
    DECLARE
    CURSOR a IS
    SELECT join_date FROM member_book;
    p_join_date DATE;
    BEGIN
    OPEN a;
    FETCH a INTO p_join_date;
    IF p_join_date> :new.issue_date THEN
    RAISE_APPLICATION_ERROR (-20322,'You may Issue book only after joining');
    elsif
    :new.return_date := :new.issue_date+15;
    end if;
    CLOSE a;
    END;
    Error(15,22): PLS-00103: Encountered the symbol "=" when expecting one of the following: . ( * @ % & = - + < / > at in is mod remainder not rem then <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || indicator multiset member submultiset
    Error(16,5): PLS-00103: Encountered the symbol "END" when expecting one of the following: begin function pragma procedure subtype type <an identifier> <a double-quoted delimited-identifier> current cursor delete exists prior

    /* Formatted on 2012/04/25 14:22 (Formatter Plus v4.8.8) */
    CREATE OR REPLACE TRIGGER issue_book_tri
      BEFORE INSERT
      ON issue_book
      FOR EACH ROW
    DECLARE
      CURSOR a
      IS
        SELECT join_date
          FROM member_book;
      p_join_date   DATE;
    BEGIN
      OPEN a;
      FETCH a
       INTO p_join_date;
      IF p_join_date > :NEW.issue_date
      THEN
        raise_application_error (-20322, 'You may Issue book only after joining');
      ELSIF 1 = 1 -- uuuuuu miss the condition here
      THEN
        :NEW.return_date := :NEW.issue_date + 15;
      END IF;
      CLOSE a;
    END;

  • How to resolve the error in trigger

    Hi,
    I've written the trigger and the logic is correct but unable to resolve the error.. Could you please suggest me to resolve the error...
    Solved
    Thank you
    Edited by: Smile on Feb 19, 2013 2:34 AM                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Yes you can very well do that
    See the example below. I have three tables.
    SQL> create table t1(no integer)
      2  /
    Table created.
    SQL> create table t2(no integer)
      2  /
    Table created.
    SQL> create table t(no integer)
      2  /
    Table created.I have inserted sample data into t
    SQL> insert into t
      2  select level
      3    from dual
      4  connect by level <= 10
      5  /
    10 rows created.
    SQL> commit
      2  /Now i want to insert even numbers into table t1 and odd numbers into table t2
    SQL> begin
      2     insert all
      3             when (mod(no,2) = 0) then
      4                     into t1 (no) values(no)
      5             else
      6                     into t2 (no) values(no)
      7     select no
      8       from t;
      9  end;
    10  /
    PL/SQL procedure successfully completed.The output is below...
    SQL> select * from t1
      2  /
            NO
             2
             4
             6
             8
            10
    SQL> select * from t2
      2  /
            NO
             1
             3
             5
             7
             9Thanks,
    Karthick.

  • Process chain - After error ABAP - trigger a metachain start does not work.

    Hi,
    I have a process chain, where after an ABAP runs into red (ERROR MESSAGE triggered), another process type, like start a new meta-chain, or start an infopackage starts.... But is does not work. After i go to logs, it asks me whether i want to trigger the following jobs, if i choose yes, it works. But i need to start it automatically, when the ABAP Routine has an error message (RED) in the chain.
    Any idea, because I tried to solve it all the day, but i did not manage to get itwork...
    Many Thanks,
    L.

    Hi,
    the problem is not the ABAP Program.
    I have the following situation:
    A Metachain contains as second step a call of local chain. After the local chain, according to the status of it (green o red), we have other different steps. So we have two different link (red and green) starting from the local process chain step.
    Inside the local process chain there is the ABAP program that check several parameters and if something is not as expected fails with status red. if this situation happens, the local process chain becomes red and in SM37 inside the job i see the error that i forced, but the status is not triggered to the first metachain , so the corresponding following steps are not triggered.
    This issue happens only if fails the ABAP program because, for example, a Infopackages loading fails every thing works and the corresponding steps in the metachain are executed.
    In the ABAP program in order to force the status red we have the following code:
    MESSAGE e162(00) WITH 'Status' 'Red'.
    Any idea?
    Thanks,
    Veronica

  • Raising errors in trigger of table underlying OAF page

    we have the standard customer page of Oracle R12. We are modifying the triggers of the TCA tables to check for certain conditions during updates.
    In the trigger I am checking for a condition and setting an error message as follows :
    IF nvl(:OLD.ATTRIBUTE1, 'APPROVED') NOT IN ('NEW', 'APPROVED', 'REJECTED') THEN
    FND_MESSAGE.SET_NAME('AR', 'XO2C_SALES_UPD_ERROR');
         raise_application_error(-20000,fnd_message.get);          
    END IF;
    I want only this error message to appear on the page. however the message shown on the page is :
    The following SQL error occurred: ORA-20000: cannot update record in pending status ORA-06512: at "APPS.XO2C_HZ_PARTY_ACCT_PREUPD_T1", line 26 ORA-04088: error during execution of trigger 'APPS.XO2C_HZ_PARTY_ACCT_PREUPD_T1'.
    I want only the line "cannot update record in pending status " to be shown. How do i acheive this. Is it becuase the error is raised in a trigger versus a procedure that the page shows it in this manner ?
    please help.
    thanks,

    You need to extend the CO and put the logic discussed in the thread in it.. to make this happen.
    --Mukul                                                                                                                                                                                                                               

  • Error in trigger: PLS-00049: bad bind variable

    Hi,
    I am trying one of the XML/XDK samples from technet (http://otn.oracle.com/tech/xml/htdocs/XDBDemo2.html) and get this error while compiling the trigger: here's the code snippet
    create or replace trigger PURCHASEORDEREXPLOSION
    instead of insert on NEWPURCHASEORDER
    for each row
    declare
    begin
    DOCUMENT := :new.PODOCUMENT; <--Error here: PLS-00049: bad bind variable 'NEW.PODOCUMENT'
    I can't understand why is this happening? Any clues??
    Thanks!
    -Rajeev

    You don't specify bind variables with the colon ":" prefix in PL/SQL.
    The procedure you posted builds a query using string concatenation. Even if you remove the colon from your variable name you still won't be using bind variables.
    If you want to use bind variables you should consider doing the following:
    1. Use the DBMS_SQL package.
    2. Use EXECUTE IMMEDIATE with the USING clause.
    3. Use OPEN <REF CURSOR> FOR <STATEMENT> with the USING clause.
    Each one has different advantages/disadvantages.
    If looks as if you want to pass in a dynamic IN list. If you use bind variables it will effectively treat the entire list as ONE value enclosed in single quotes. If you truly want a dynamic IN list you need to investigate another method.
    Tom Kyte has some information on Dynamic IN lists here: [How can I do a variable in list?|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425]

  • Error in trigger (simple)

    hi ,
    I 've written the following trigger but unable to trace why the following errors ..
    All the columns are written properly as per the table ...
    CREATE OR REPLACE TRIGGER TRI1
    AFTER INSERT OR UPDATE OR DELETE
    OF INL_ID,MRR_CD, REQ, MM, ML_STS, FLL_TMST, LLL_TMST, CAT, LOAT
    ON F_FL_T
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    INSERT INTO MBF_D(
                C_ID,
                DMBF,
                ROGF , 
                RMBF,
                RSF,
                MSEQ,
                MNM,
                MCD,
                MNM,
                TCLL,
                TCLL,
                T_DAT,
                TDAT,
                OUAT,
                AD,
                MP)
         VALUES(1,1,1,1,1,1,'A','W','W',SYSDATE,
          SYSDATE,SYSDATE,SYSDATE,'N',0','I');
    END; errror::
    2/2 PL/SQL: SQL Statement ignored
    5/26 PL/SQL: ORA-00911: invalid character
    21/4 PLS-00103: Encountered the symbol "end-of-file" when expecting
    one of the following:
    thanks,
    josh

    How did you able to create that table which has duplicate column name?
    Check your code ->
    INSERT INTO MBF_D(
    C_ID,
    DMBF,
    ROGF ,
    RMBF,
    RSF,
    MSEQ,
    MNM,
    MCD,
    MNM,
    TCLL,
    TCLL,
    T_DAT,
    TDAT,
    OUAT,
    AD,
    MP)
    VALUES(1,1,1,1,1,1,'A','W','W',SYSDATE,
    SYSDATE,SYSDATE,SYSDATE,'N',0,'I');
    See the bold part in your script. Did you create using any double quotes?
    See one test ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.02
    satyaki>
    satyaki>create table test_sss
      2      (
      3        eno  number(5),
      4        eno  number(5)
      5      );
          eno  number(5)
    ERROR at line 4:
    ORA-00957: duplicate column name
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>create table test_sss
      2      (
      3        eno  number(5),
      4        "eno" number(5)
      5      );
    Table created.
    Elapsed: 00:00:01.01
    satyaki>
    satyaki>Can you explain?
    Regards.
    Satyaki De.

  • ORA-00604/ORA-01422/ORA-06512 Error on trigger

    Hi,
    I have an database which is of version 10.2.0.3.0 on Enterprise Edition.
    I want to restrict a user from usage of an schema . Therefore i have written a trigger but i have encountered with another errors:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 5
    Trigger Being::
    SQL> create or replace trigger session_access
    2 after logon on database
    3 declare
    4 v_username varchar2(30);
    5 v_osuser varchar2(30);
    6 begin
    7 select username,osuser into v_username,v_osuser from v$session;
    8 if v_username = 'SUSANJO' and v_osuser= 'ORACLE' then
    9 raise_application_error (-20001,'Access restricted for this USER');
    10 end if;
    11 end;
    12 /
    Trigger created.
    SQL> show errors;
    No errors.
    SQL> connect susanjo
    Enter password:
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 5
    Warning: You are no longer connected to ORACLE.
    i have run out of ideas of whats to be done onto the trigger now.
    Regards.
    Susan John

    Um , i have implemented the following pl/sql. It seem to kick the person out BUT (now this is a big BUT) within the grid control it mentions :
    Details          Failed to connect to database instance: ORA-00604: error occurred at recursive SQL level 1.
    create or replace trigger session_access
    DECLARE
    v_username sys.v_$session.username%type;
    v_osuser sys.v_$session.osuser%type;
    BEGIN
    select s.username ,s.osuser into v_username,v_osuser
    from v$session s where s.username='SUSANJO' and s.osuser='oracle';
    IF (v_username ='SUSANJO' AND V_OSUSER='oracle' )
    THEN
    RAISE_APPLICATION_ERROR(-20001, 'You are not allowed to login using the program');
    END IF;
    END session_access;
    Output :
    SQL*Plus: Release 10.2.0.3.0 - Production on Mon Mar 23 12:36:43 2009
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning and Data Mining options
    SQL> connect susanjo
    Enter password:
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20001: You are not allowed to login using the program
    ORA-06512: at line 10
    Warning: You are no longer connected to ORACLE.
    SQL>
    I did conduct a research which was not all that helpful too. So i am back to square one again.
    regards
    Susan John

  • Error in Trigger (PL/SQL: SQL Statement Ignored)

    Here is the trigger:
    CREATE OR REPLACE TRIGGER DRUGREPLACEMENT
    AFTER INSERT ON PHARMACEUTICALS
    REFERENCING NEW AS newDrugs
    FOR EACH ROW
    WHEN (newDrugs.drugname = newDrugs.genericname)
    BEGIN
    UPDATE prescription
    SET pharmaceuticalid = newDrugs.drugID
    WHERE pharmaceuticalid IN(SELECT pharmaceuticalid FROM prescription, pharmaceuticals WHERE drugid = pharmaceuticalid AND newDrugs.genericname = pharmaceutical.genericname);
    END;
    Error is:
    Error(2,1): PL/SQL: SQL Statement ignored
    Error(3,24): PL/SQL: ORA-00904: "NEWDRUGS"."DRUGID": invalid identifier
    pharmaceuticalid is a number in my prescription table.
    drugid is a number; genericname and drugname are both varchars in my pharmaceuticals table. Any idea why I am getting these errors? (I tried putting quotes around newdrugs.drugid but then it just said "newdrugs.drugid" is invalid. Thanks for your help
    -Brian

    One more thing. Your trigger is selecting from triggering table. So single row inserts will work, but multiple row inserts into PHARMACEUTICALS will fail with famous "table is mutating" error. There is no need to select from PHARMACEUTICALS. Change:
    UPDATE ************
    SET pharmaceuticalid = newDrugs.drugID
    WHERE pharmaceuticalid IN(SELECT pharmaceuticalid FROM ************, pharmaceuticals WHERE drugid = pharmaceuticalid AND newDrugs.genericname = pharmaceutical.genericname);to
    UPDATE ************
      SET pharmaceuticalid = newDrugs.drugID
      WHERE pharmaceuticalid IN (
                                 SELECT pharmaceuticalid
                                   FROM ************
                                   WHERE drugid = :newDrugs.pharmaceuticalid
                                     AND :newDrugs.genericname = pharmaceutical.genericname
                                );SY.

  • FOUND ERROR WITH TRIGGER

    Please, i want a found a field that cause error in a trigger, how can capture this field and sending to a table_error.
    thanks

    Please, i want a found a field that cause error in a trigger, how can capture this field and sending to a table_error.
    thanks

  • Error in trigger, pls help,10g,xp

    Please help me out from the following err in trigger
    Solved
    Thank you
    Edited by: Smile on Feb 19, 2013 2:15 AM                                                                                                                                                                                                                                                           

    83  exception
    84  when others then
    85  dbms_output.put_line('error');
    86  end;The most dangerous code one could write. Must be removed immediately
    http://tkyte.blogspot.com/2007/03/dreaded-others-then-null-strikes-again.html
    Message was edited by:
    karthick_arp

  • Error in trigger the workflow

    hi ,guy ,
        I want to trigger the workflow by business application . so I added the started event(event = created) in the workflow builder basic data . it ran ok . but after I added the condition(the condition is &_EVT_OBJECT.CREATEDBY& = WORKFLOW) into the started event ,it do not work successfully .the error message is "Operator 'EQ': The value of the left operand cannot be determined" .
       can someone meet similar problem ?and give me some detail advices about it . thank in advance .
    Jialiang.Qiu

    Hi Jiuliang,
    Are you puting this variable on the Task (Workflow) Bind triggering events as binding ?
    Because I'm not finding the variable &_EVT_OBJECT.CREATEDBY& there.
    Let see if I understand. You want to know who had started the WF ? If yes, you can just create a condition using the value of CreatedByUser.ID. You can compare it with a SAP user name.
    Please try to do this and give me your feedback.
    ps.: Please, if you can send a example, send it to [email protected]
    Message was edited by: Glauco Kubrusly

Maybe you are looking for