Abdullah
Abdullah

Reputation: 1033

How to make Interactive grid code execute for all selected rows when click save button even if I don't make any changes?

How can I execute IG code for selected rows only even if I don't make any changes in the rows data ,

The idea in laboratory system result first laboratory technician will enter tests results and save ,

Next step laboratory supervisor will review entered results and release the results some times the supervisor will not make any changes in test result just he will review if its correct then he will select all rows or some rows then click on RELEASE button ,

Now its not execute the code if no changes made , this is the used code in release button :

BEGIN
 CASE :APEX$ROW_STATUS  
    WHEN 'U' THEN  
        UPDATE LAB_RESULTS 
       SET SAMPLE_STATUS = 5 ,
           APPROVED_BY = :APP_USER ,
           APPROVED_DATE = sysdate ,
           TEST_RESULT = :TEST_RESULT , 
           MACHINE_ID = :MACHINE_ID , 
           RANGE_FROM = :RANGE_FROM , 
           RANGE_TO = :RANGE_TO
   WHERE TEST_NO IN (SELECT REGEXP_SUBSTR(:P69_TEST_NO, '[^,]+', 1, LEVEL) AS TESTNO
                        FROM DUAL
                        CONNECT BY LEVEL <= REGEXP_COUNT(:P69_TEST_NO, ',') + 1)
   AND ID = :ID;
    END CASE;
END;
 

release result page

how can I execute the code for selected rows even if no changes made ?

when I removed CASE I got error ORA-06550

I got this error

I created new process and the Execution scope : All submitted rows under server-side Condition

release process

Upvotes: 0

Views: 51

Answers (1)

Littlefoot
Littlefoot

Reputation: 143053

This is the question:

(...) even if I don't make any changes in the rows data

This is your code:

CASE :APEX$ROW_STATUS  
WHEN 'U' THEN         
    UPDATE LAB_RESULTS 

which reads: UPDATE table lab_results if row status is U (i.e. row is being updated).

Therefore, if you want to apply it to rows regardless of whether they were updated or not, remove CASE expression.

Upvotes: 1

Related Questions