Oracle Apex 20.1 Automatic DML processing not working to save updates - oracle-apex-19.1

I have created an apex page with static content.
The details are as below:
Pre-rending-> fetch rows from P_IT_PEOPLE table with primary key person_id defined.
Region-> The columns which are to be used defined along with primary key PERSON_ID which is kept hidden.
other items-> P5_ASSIGNED_DEPT,P5_APPROVER,P5_PERSON_NAME.
Region Buttons-> SAVE/CANCEL
SAVE-> Server side-> Submit-> SQL Update action
Processing:
Create process rows of P_IT_PEOPLE
Automatic Row Fetch Legacy
Table name, primary key defined (PERSON_ID)
Supported operations-> only update selected as i just want this page to update the columns person_name, assigned_dept and approver accordingly.
Whatever fields i enter should get updated in the table.
However in app, after i click save, no updates. It is successful but neither db, nor front end, nowhere updates happen.
What am i doing wrong?
[1]: https://i.stack.imgur.com/7JpNA.png
[2]: https://i.stack.imgur.com/UjbXD.png

Related

Oracle Materialized View has duplicate entries

I defined a matView for fast refresh by rowid and from time to time I got duplicated entries for the primary key. The master table definitely has no double entries. The view accesses a remote DB.
I cannot refresh via primary key, because I need to have an outer join in case the referenced id is null.
Most of the time it works fine, but every 1000 entries or so I get an entry twice.
When I update this duplicated record in the master, the refresh of the view "repairs" the record and I have a single record.
We have a RAC cluster with 2 instances.
create materialized view teststatussetat
refresh force on demand with rowid
as
select
ctssa.uuid id,
ctssa.uuid,
ctssa.rowid ctssa_rowid,
ctps.rowid ctps_rowid,
ssf.rowid ssf_rowid,
ctssa.coretestid coretest_uuid,
ctssa.lastupdate,
ctssa.pstatussetat statussetat,
ctps.code status_code,
ssf.account statussetfrom
from
coreteststatussetat#coredb ctssa,
coretestprocessstatusrev#coredb ctps,
coreuser#coredb ssf
where
ssf.uuid(+) = ctssa.statussetfromid and
ctps.uuid = ctssa.statusid
;
The log files are created like this:
create materialized view log on coreteststatussetat with sequence, rowid, primary key including new values;
We have an Oracle Database 19c Enterprise Edition Release 19.0.0.0.0.
To watch what happens I created a job which checks every 5 seconds, if the view contains duplicates for one day. The job found thousands of duplicate entries during the day but most of them (but not all) vanished away, so were there only temporary. The job protololled the primary key and also the rowid, so I hoped that I can find some changing rowids. But all of the duplicated primary keys have distinct rowids.
The data is created via Hibernate. But this should not make a difference. Oracle should not create duplicate entries.

How to resolve error ORA-20987: APEX - ORA-02015?

I have a page in apex with multiple interactive grid. In one of the interactive grid i am trying to update the data of a column of a table in the database. The column named defect kind is a dropdown in the grid and on click of save should be able to updated the column value in database with the selected value in the grid.
While clicking on save apex is showing an error as follows:
Ajax call returned server error ORA-20987: APEX - ORA-02015: cannot select FOR UPDATE from remote table for.
I have used the type interactive grid - automatic row processing(DML) for saving the grid. Only defect kind is selected by the user rest all column value are coming directly from the table.
Interactive grid image:
NOTE:For this workspace the tables are accessed through a database link. I am using APEX 5.1.
This error is raised specifically because you are working over a database link.
Error code: ORA-02015
Description: cannot select FOR UPDATE from remote table
Cause: An attempt was made to select FOR UPDATE on a remote table (directly, or via a view) that had abstract data type columns, and the
view or select list contained abstract data type columns or non-column
items.
Action: To attempt a select FOR UPDATE, use a view or select list that consists only of base columns from the remote table, none of
which may be abstract data type columns.
I can't tell from what you've posted if the issue is with the query you're using to populate the IG or with some underlying view or the table itself. Depending your ability to locate and remove the "abstract data type columns or non-column items" (if that's even possible with an IG) you may not be able to make this work with automatic row processing over a database link at all. It may require a custom PL/SQL API instead.
Have you tried to set the attribute Lock Row (group Settings) to No in your Interactive Grid - automatic row processing(DML) process?

session item does not change when using lov in primary key

I am implementing a Interactive grid to perform DML operations on a table.
it has combined primary key of two columns
One primary key column is display only and refer to master table and another primary key column I want to have a LOV to select value. LOV is dynamic lov having a display and return value picked from another table.
Inserts are fine but session state item value is set for one row and all the operations are performed on that same row irrespective of which row is selected.
you can see a sample here
https://apex.oracle.com/pls/apex/f?p=128616:2:1964277347439::NO:::
master table name: sample
detail table name: sample_child
primary key in sample child : ID and Name
pop lov is implemented in NAME
LOV values are picked from table: Sample_uncle
LOV display : ID || '-' || NAME
LOV return : ID
you can try to update blabla column of sample_child table to see the issue.
I am not sure how I can give you access to look at the implementation.
I have already tried all the options I can think of
This is to do with your primary keys, the detail table does not appear to have proper ones, thats why it always tried to update the first entry, and I think this is also why every row is marked when you load the table.
Primary keys also do the annoying thing of refusing to be empty, as you can see if you insert a new row, the middle column(which is a PK) is filled with 't1001'.
Since you are dealing with simple tables(and not a whole bunch of joined tables) I always consider it best to use ROWID as PK. So set ROWID as PK for the master table, and ROWID for the detail table. And have the detail table have a Master table be your master table, and then click on the first column in the detail table and set the master column for it. And I also personaly always hide the column that is linked.
I would advise you use ROWID whenever possible as its just so much easier to work with, it does mean you might need to set up a validation to prevent someone adding duplicated values for your actual PK, but since the PK is in the underlying table, they cant enter it anyways(but if you have a validation, the error will be much prettier), whilst if the column is a PK, APEX will prevent duplicates by default.
I hope this helps

Oracle APEX DML form (with no report) doesn't show existing data in the table

I've been able to create APEX forms with reports and interactive grids successfully, but when I tried to just create a simple DML form, using the wizard, I get a page where I can create a row, but I can't see the existing data in the table.
This particular table always has only one row and I just need a form to update that 1 row. How can I get this view to open in update mode?
If you don't know ahead of time what any of the values in one of the columns, you can use ROWID as the primary key and set it to the row's ROWID in order to trigger the automatic row fetch process.
Create a hidden item called P1_ROWID. Its Source should be set to Database Column, ROWID.
On the Automatic Row Fetch process, set Primary Key Column to ROWID and Primary Key Item to P1_ROWID.
Create an additional process, to run before the automatic row fetch process, that executes a query like the following:
select rowid into :P1_ROWID from mytable;

get values from another table on a trigger

So, i am a begginer on ORACLE and realy would apreciate your help.
I have 3 tables, EMPLOEES, PERSONAL_DATA and RECORDS. I want to create an UPDATE TRIGGER that when fires takes the old values of EMPLOOES finds the personal data of that updating emplooe on the PERSONAL_DATA table with the OLD id and insert all of that data( the OLD of EMPLOOES and the one fetched from PERSONAL_DATA) into the RECORDS table. I been triying to use the SELECT sentence to fetch information from the table PERSONAL_DATA, but the compiler throws me an error.

Resources