Home » Developer & Programmer » Forms » updating data into table through non-database column in a form
updating data into table through non-database column in a form [message #601753] Mon, 25 November 2013 05:38 Go to next message
nkumar0130
Messages: 55
Registered: August 2013
Location: Bangalore
Member
Hi,

In a block I have 7 column, among 7 column 5 are database column and other 2 are non database column.
suppose 5 column belong to EMP table and other 2 column belong to STU table.
both the table are linked through emp_id.
I am not supposed to create a view so i have created the 5 column based on EMP table and other 2 column is non-database column.
through POST_QUERY trigger i am displaying the value in the 2 column of STU table.

When I am updating the 2 column of STU table alone through form it is not updating.
But when I am updating the 2 column of STU table along the 5 column of EMP table it is getting update.

Please help me with the solution so that i can update only the 2 STU column.

Thanks
Re: updating data into table through non-database column in a form [message #601754 is a reply to message #601753] Mon, 25 November 2013 05:44 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
How is stu getting updated if the emp columns are changed?
Re: updating data into table through non-database column in a form [message #601755 is a reply to message #601754] Mon, 25 November 2013 05:46 Go to previous messageGo to next message
nkumar0130
Messages: 55
Registered: August 2013
Location: Bangalore
Member
I have used a trigger ON-UPDATE trigger and calling a procedure through this trigger.
Inside pocedure i have written a update command to update the both the table.
Re: updating data into table through non-database column in a form [message #601761 is a reply to message #601755] Mon, 25 November 2013 06:21 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
You could trick forms into thinking one of emp columns has changed, something like this in the when-validate-item on the stu items:
DECLARE

l_cur_val emp.<item>%type := :emp.<item>;

BEGIN

:emp.<item> := '????????';
:emp.<item> := l_cur_val;

END;

You'll need to pick an item without any validation triggers of it's own.

Alternatively:
1) base the block on a view
2) base the block on a stored procedure

Re: updating data into table through non-database column in a form [message #601762 is a reply to message #601761] Mon, 25 November 2013 06:22 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'd move the stored procedure call to pre-update and ditch the on-update trigger.
Re: updating data into table through non-database column in a form [message #601772 is a reply to message #601762] Mon, 25 November 2013 07:25 Go to previous message
nkumar0130
Messages: 55
Registered: August 2013
Location: Bangalore
Member
Thanks for the solution.
It worked.
Previous Topic: How to move from one item to another using up or down arrow button
Next Topic: Oracle forms 6i to Oracle forms 10g forms migration
Goto Forum:
  


Current Time: Fri Apr 19 21:58:54 CDT 2024