0
votes

I'm trying to make interactive grid page in Oracle Apex 18.

I have three databases in my oracle workspace. first is a category, second is content, third is a mapping table between category and content (category can have multiple contents, so does content)

category table just like this:

| CATEGORY_ID | CATEGORY_NAME |<br/>
|  01         |  Comedy       |  <br/>
|  02         |  Horror       |   <br/>
|  03         |  Romance      |   <br/>

content table just like this:

| CONTENT_ID | CONTENT_NAME  |<br/>
|    A       | little prince |<br/>
|    B       | rabbit        |<br/>
|    C       | blahblah      |<br/>

and mapping table like this:

| MAPPING_ID | CATEGORY_ID | CONTENT_ID | PRIORITY |<br/>
|   aa       |    01       |   A        |    2     |<br/>
|   bb       |    02       |   A        |    1     |<br/>
|   cc       |    01       |   B        |    5     |<br/>
|   dd       |    03       |   B        |    2     |<br/>
|   ee       |    02       |   C        |    3     |<br/>
|   ff       |    03       |   C        |    4     |<br/>

priority is used when ordering group by CATEGORY and I want to make Interactive grid like this.

select <br/>
  MAPPING_ID,<br/>
  PRIORITY,<br/>
  CATEGORY_ID,<br/>
  CONTENT_ID,<br/>
  (select CONTENT_NAME from CONTENT where CONTENT_ID=CONTENT_ID) as content name,<br/>
  (select CATEGORY_NAME from CATEGORY where CATEGORY_ID=CATEGORY_ID) as category name<br/>
from MAPPING_TABLE;

I want to edit only priority row in that interactive grid, and also update MAPPING_TABLE element(just for priority). (to be actually accepted result in the real table)

but when I edit priority value in the interactive grid and click the save button, I got the message like:

Ajax call returned server error ORA-20987: APEX - Process ' Save Interactive Grid Data' raised 'ORA-02014: can not use FOR UPDATE statement' while performing row locking. This error can occur when the process issues a SELECT FOR UPDATE on a complex view with an instead-of trigger, to lock the row. Set the process attribute 'Lock Row' to No or PL/SQL Code. - Contact your application administrator. for .

How can I fix it? And in advance, thank you :)

1

1 Answers

0
votes

Hello Miroslav Glamuzina,

Set the relationship columns (foreign keys) as query only. You can only edit the columns of main table in interactive grids

enter image description here