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!

Interactive grid custom record save

XandotJul 24 2020 — edited Aug 3 2020

Hello,

I'm facing some issues to save the data in IG.

Apex version: 5.1 and DB: 12.2

source table:

create table match_results ( match_date date, location varchar2(20), home_team_name varchar2(20), away_team_name varchar2(20), home_team_points integer);

insert into match_results values ( '2020-01-01', 'Snowley', 'Underrated United', 'Terrible Town', 2);

insert into match_results values ( '2020-01-01', 'Coldgate', 'Average Athletic', 'Champions City', 1);

insert into match_results values ( '2020-02-01', 'Dorwall', 'Terrible Town', 'Average Athletic', 0);

insert into match_results values ( '2020-03-01', 'Coldgate', 'Average Athletic', 'Underrated United', 3);

insert into match_results values ( '2020-03-01', 'Newdell', 'Champions City', 'Terrible Town', 8 );

insert into match_results values ( '2020-04-01', 'Newdell', 'Champions City', 'Terrible Town', 10 );

insert into match_results values ( '2020-05-01', 'Dorwall', 'Terrible Town', 'Average Athletic', 0 );

commit;

Created IG using the query:

with rws as (

select location,home_team_name, away_team_name, home_team_points,

     to\_char ( match\_date, 'MON' ) match\_mm

from match_results

),

pvt as

(select * from rws a

pivot (

sum (home\_team\_points) for match\_mm in ('JAN', 'FEB' , 'MAR','APR','MAY','JUN','JUL'))  

)

select rownum, p.* from pvt p;

The grid looks like: aggregated data based on months

pastedImage_0.png

Note: let's say, user-entered four new values in highlighted cells "yellow" and press save button

When the user clicks to SAVE button:

1 - newly added cells should be inserted into the table in the following format:

| match_date | location | home_team_name | away_team_name | home_team_points |
| 1/7/2020 | Coldgate | Average Athletic | Champions City | 70 |
| 1/2/2020 | Snowley | Underrated United | Terrible Town | 10 |
| 1/2/2020 | Coldgate | Average Athletic | Underrated United | 29 |
| 1/6/2020 | Coldgate | Average Athletic | Underrated United | 40 |

2- similarly if the user modifies existing entries/ add new row then those entries should also be inserted in the same way.

please help me out.

Thanks in advance

This post has been answered by Keyser on Jul 24 2020
Jump to Answer
Comments
Post Details
Added on Jul 24 2020
6 comments
4,735 views