title: PLS-00049 BAD BIND VARIABLE
body: <p>I'm trying to set up a trigger so that  whenever the PL_Witness table is updated, it makes a record of this in the PLAUDWIT table which is an auditing table.</p>
  
  <p>However, every single time I try to make this trigger I get bad bind variable, and I am getting this on other audit triggers I am attempting to make too. What is my common issue?</p>
  
  <p>All Help is appreciated!</p>
  
  <pre><code>CREATE TABLE  "PL_WITNESS" 
     (    "WITNESS_ID" NUMBER(*,0) NOT NULL ENABLE, 
      "WITNESS_NAME" VARCHAR2(30) NOT NULL ENABLE, 
      "WITNESS_ADDRESS" VARCHAR2(100), 
      "FK1_WITNESS_TYPE_ID" NUMBER(*,0) NOT NULL ENABLE, 
       CONSTRAINT "PK_WITNESS" PRIMARY KEY ("WITNESS_ID") ENABLE
     )
  /
  ALTER TABLE  "PL_WITNESS" ADD CONSTRAINT "FK1_WITNESS_WTYPE" FOREIGN KEY         ("FK1_WITNESS_TYPE_ID")
        REFERENCES  "PL_WITNESS_TYPE" ("WITNESS_TYPE_ID") ENABLE
  /
  </code></pre>
  
  <p>.</p>
  
  <pre><code>DROP TABLE PLAUDWIT
  CREATE TABLE PLAUDWIT (
  AUD_AWitnessID NUMBER,
  AUD_AWitnessType NUMBER, 
  AUDIT_USER varchar2(50),
  AUDIT_DATE DATE,
  AUDIT_ACTION varchar2(10));
  </code></pre>
  
  <p>.
      CREATE OR REPLACE TRIGGER TRG_PLAUDWIT</p>
  
  <pre><code>AFTER INSERT OR DELETE OR UPDATE ON PL_WITNESS
  FOR EACH ROW
  DECLARE
  v_trigger_task varchar2(10);
  
  BEGIN
  IF UPDATING
    THEN
      v_trigger_task := 'Update';
  ELSIF DELETING
  THEN
  v_trigger_task := 'DELETE';
  ELSIF INSERTING
  THEN
  v_trigger_task := 'INSERT';
  ELSE
  v_trigger_task := NULL;
  END IF;
  
  IF v_trigger_task IN ('DELETE','UPDATE') THEN
  INSERT INTO PLAUDWIT (AWitnessID, AWitnessType, AUDIT_USER, AUDIT_DATE, AUDIT_ACTION)
  VALUES
  (:OLD.AWitnessID, :OLD.AWitnessType, UPPER(v('APP USER')), SYSDATE, v_trigger_task);
  ELSE
  
  INSERT INTO PLAUDWIT (AWitnessID, AWitnessType, AUDIT_USER, AUDIT_DATE, AUDIT_ACTION)
  VALUES
  (:NEW.AWitnessID, :NEW.AWitnessType, UPPER(v('APP USER')), SYSDATE, v_trigger_task);
  END IF;
  </code></pre>
  
  <p>END TRG_PLAUDWIT;</p>