Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What is wrong with this PL/SQL code, and how to debug it in Apex?

DannyS-OracleAug 4 2016 — edited Aug 5 2016

Hi guys, I am fairly new in Apex and still struggling on some basic things like debugging this PL/SQL procedure. Hopefully someone can help me on this:

I made this PL/SQL procedure to do some insert operations by looping through another table's records:

DECLARE

    l_test_id number := :P5_ID;

    l_test_type varchar2(50) := :P5_TEST_TYPE;

    CURSOR c_criteria is

      SELECT ID FROM DR_APP_TABLETOP_CRITERIA;

BEGIN

    IF l_test_type = 'Tabletop' THEN

        FOR r_criteria IN c_criteria

        LOOP

            INSERT INTO DR_APP_TABLETOP_WORKBOOK(ID_TEST, ID_CRITERIA)

            VALUES (l_test_id, r_criteria.ID);

        END LOOP;

        COMMIT;

    END IF;

END;

There is no error on the Apex debugger, but the INSERT operations never happened. Does anyone notice error in this code? Or, can someone teach me on how to print simple log message on the debugger? Something like "System.out.println()" in Java - so I can debug the PL/SQL easier. Surprisingly this thing is not easy to find on the Internet: I tried DBMS_OUTPUT and APEX_DEBUG functions but got no luck - probably I was doing it wrong .... Any help will be appreciated!

In case you wonder, I used Apex v5.0.4.

Thank you!

This post has been answered by Bharat G on Aug 5 2016
Jump to Answer

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 2 2016
Added on Aug 4 2016
10 comments
2,150 views