0
votes

I have an interactive report, where the query is combined, so I can't use editable interactive grid. That's why I have to use manual form in my query. I've found some nice tips about the APEX_ITEMs, but I have problem with my process.

In my query there are columns like:

APEX_ITEM.HIDDEN(1,coursestudent.id)
...
APEX_ITEM.SELECT_LIST(2,coursestudent.signed,'Signed;1,Failed;0')

I have a submit button, and here is my process:

FOR i in 1..apex_application.g_f01.count LOOP
    UPDATE coursestudent
    SET signed=apex_application.g_f02(i)
    WHERE id=apex_application.g_f01(i);
END LOOP;

I've thought that it's not too difficult, but after I press Submit nothing happens, except that the Success message is written out the page.

What should I do?

Submit Button

Process

I'm using the Oracle Apex version: 5.1.1.00.08

1
Add some debug to the code, e.g. apex_debug.message('g_f01='||apex_application.g_f01(i)||' g_f02='||apex_application.g_f02(i)); within the loop, and check the debug logs to see what values the submit process gets. Note that your UPDATE statement will do nothing (and not raise any exception) if the where clause finds no matching rows (or if g_f01(i) happens to be null).Jeffrey Kemp
Yes, the problem is, that the apex_application.g_f01(i) variable is NULL, but then how I should refer the table's elements?Manasse
That is how you refer to the posted items. If they're null then that means the items are probably being initialised with nulls. Have a look at the generated HTML for the page and check what values are being generated, e.g. for the hidden item.Jeffrey Kemp
Thank you for your advices! So, I found the error: it is a bug. I had to copy-paste the sql query again, and it works now. I've faced this bug before that, sometimes the new columns just don't showing in the page. Since I put the hidden column after I first create the query, it hadn't shown in the page, so the loop in the process never worked.Manasse

1 Answers

0
votes

Thanks to Jeffrey, I found the error: it is a bug.

I had to copy-paste the sql query again, and it works now. Ok, really, in that case I always put a select 1 from dual in it's place, save, and just after that paste back the query.

I've faced this bug before that, sometimes the new columns just don't showing in the page. Since I put the hidden column after I first create the query, it hadn't shown in the page, so the loop in the process never worked.