Home > Back-end >  How to write multiple statements in if in oracle
How to write multiple statements in if in oracle

Time:04-21

DECLARE
    NO_OF_ROWS_A NUMBER := 0;
    NO_OF_ROWS_E NUMBER := 0;
BEGIN
    
    FOR OBJ IN (select status from  table1)
    LOOP
    
    if(condition) THEN
    
     UPDATE table2 SET status=1 WHERE condition;
     NO_OF_ROWS_A = NO_OF_ROWS_A 1;
    END IF;
    END LOOP;
END

I am getting error at "NO_OF_ROWS_A = NO_OF_ROWS_A 1;"

Can anyone please tell me what went wrong?

CodePudding user response:

Offending statement should be

NO_OF_ROWS_A := NO_OF_ROWS_A   1;
             ^ 
             |
            this
  • Related