Question: I know I can use `CASE` statement inside `VALUES` part of an insert statement but I am a bit confused.

I have a statement like,

Answer: 
You can try also a procedure:

```
create or replace procedure insert_XYZ (P_ED_MSISDN         IN VARCHAR2,
                                        P_ED_OTHER_PARTY    IN VARCHAR2) is

begin  

    INSERT INTO TABLE_XYZ ( ED_MSISDN, 
                            ED_OTHER_PARTY,  
                            ED_DURATION) 
      VALUES (P_ED_MSISDN , 
              P_ED_OTHER_PARTY , 
              CASE  
                  WHEN P_ED_OTHER_PARTY = '6598898745' THEN 
                      '9999999' 
                  ELSE
                      '88888' 
              END);

END;

```
You cannot self-reference a column in an `insert` statement - that would cause an "ORA-00984: column not allowed here" error.

You could, however, use a `before insert` trigger to achieve the same functionality:

```
CREATE OR REPLACE TRIGGER table_xyz_tr
BEFORE INSERT ON table_xyz
FOR EACH ROW
    NEW.ed_duration = CASE NEW.ed_other_party 
                      WHEN '6598898745' THEN '9999999' 
                      ELSE '88888' END;
END;

```