Question

I use squirrel 3.2.0 When I try to replace this trigger:

CREATE OR REPLACE TRIGGER crw_ins_trig
  BEFORE INSERT OR UPDATE ON crew
  FOR EACH ROW
DECLARE

BEGIN
    if (:new.crw_id is null) then
        select crw_id_seq.nextval
        into :new.crw_id
        from dual;
    end if;  
END;
/

I get the message "Please input the parameter values. Value for ':new'"

When I click OK the result message is:

Warning:   Warning: execution completed with warning
SQLState:  null
ErrorCode: 17110
Position: 27

Query 1 of 1, Rows read: 0, Elapsed time (seconds) - Total: 0.023, SQL query: 0.023, Building output: 0

In my application I get an error "ORA-04098: trigger 'CRW_INS_TRIG' is invalid and failed re-validation"

Does this has to do with Squirrel? If so, how can I solve this?

Was it helpful?

Solution

You should unload "sqlparam" plugin in SQuirrel, after that it won't ask you to fill values for ":paramName" variables

OTHER TIPS

You might want to add a REFERENCING line to your trigger so that it would look like

CREATE OR REPLACE TRIGGER crw_ins_trig  
  BEFORE INSERT OR UPDATE ON crew  
  REFERENCING NEW AS NEW
              OLD AS OLD
  FOR EACH ROW  
BEGIN  
    if (:new.crw_id is null) then  
        select crw_id_seq.nextval  
        into :new.crw_id  
        from dual;  
    end if;    
END crw_ins_trig;

Try that. If it doesn't work, try executing the statement using a different tool (e.g. SQL*Plus, PL/SQL Developer, Toad, etc).

Share and enjoy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top