2 Replies Latest reply: Jul 29, 2013 9:16 AM by 34MCA2K2 RSS

    Regarding equal operator with IF condition

    794544

      Hello,

       

      Apologies, if this question is repeating.

       

      I am using one plsql block in that there is one if condition and if condition doesn't satisfy, and then also pointer go inside of IF condition.

      I'm giving the following scenario:

       

      CREATE TABLE TABLE1 (process_name varchar2(30),file_name varchar2(50),file_path varchar2(60), mutyn char(1));

      there is primary key on process_name

       

      DECLARE

      REC_VAR  TABLE1%ROWTYPE;

      BEGIN

      SELECT * INTO REC_VAR FROM TABLE1 WHERE process_name= 'M_MASTER' ;

       

      IF REC_VAR.mutyn = 'G' THEN --- assumed REC_VAR.mutyn value is coming I

      --- something

      END IF;

      END;

       

      NOTE: In above condition REC_VAR.mutyn='I' then also satifies if condition.......  If i put 'IN' at the place of '=' then it works fine. Why does it happen?