0 Replies Latest reply on Nov 1, 2013 9:42 PM by BillArms_GS

    Unit Testing - Did it get inserted?

    BillArms_GS

      I have a procedure that takes a few parameters and parses them for inserting in a table for logging purposes.  Except for the date / time the table entries can be the same in many rows. For unit testing, I want to check that there is a row inserted with the given data after the setup. So in the startup process I execute:

       

      DECLARE          

        v_Datetime Date;          

      BEGIN          

        v_Datetime := sysdate;          

      END;         

       

      In the validation process I attempt to identify the row as being inserted.

       

      SELECT count(*)      

      FROM ACCESS_LOGS      

      WHERE USER_PERM = P_USER_NBR      

      AND FUNC_TYPE = PFUNC_TYPE      

      AND v_Datetime < to_DATE(LOG_VAR_DATE || ' ' || LOG_VAR_TIME, 'MM-DD-YYYY HH24:MI:SS');      

       

      SQL Developer UniTest sees v_Dateime as an invalid identifier. Is there a way to get the value of a variable which was populated in startup to the validation process?

      Regards,

      Bill