Home » Developer & Programmer » Forms » Unable to update the record in oracle forms (oracle froms 10g)
Unable to update the record in oracle forms [message #506708] Tue, 10 May 2011 12:54 Go to next message
kvkpraveen
Messages: 20
Registered: June 2010
Location: Bangalore
Junior Member
Hi All

I have the search screen in my form so after searching if i select the row by using the button it will navigate the first tab page that is "gas" screen here if i tried to change the value like update and save the form it is not allowing me to update the value raising the error message "oracle unable to insert the record". if i see the "display error" in menu it is having the select statement with error "unique key viloation error ora-00001" Please provide the solution.


In save button containe "commit_form"

Regards
Praveen.K
Re: Unable to update the record in oracle forms [message #506709 is a reply to message #506708] Tue, 10 May 2011 12:56 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
That would be because you are populating the block with a select statement rather than using forms query functionality.
Because of that oracle thinks the record is new one and tries to insert it rather than update it.
You need to either:
a) use forms default query functionality (enter_query and execute_query)
b) or write your own procedure to do the update.
Re: Unable to update the record in oracle forms [message #506721 is a reply to message #506709] Tue, 10 May 2011 21:26 Go to previous messageGo to next message
kvkpraveen
Messages: 20
Registered: June 2010
Location: Bangalore
Junior Member
Hi cookiemonster

Thanks for your quick reply so here shall i write the statement :system.form_status <> 'QUERY' then <update statement>
in "when-button-pressed" or "procedure"
Re: Unable to update the record in oracle forms [message #506728 is a reply to message #506721] Wed, 11 May 2011 00:08 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
a) is my favorite approach.
b) is something I avoid whenever I can.
Re: Unable to update the record in oracle forms [message #506765 is a reply to message #506728] Wed, 11 May 2011 03:24 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Indeed, use the built-in query functionality unless there is a very good reason why you are unable to do so.
Re: Unable to update the record in oracle forms [message #506811 is a reply to message #506765] Wed, 11 May 2011 06:21 Go to previous messageGo to next message
kvkpraveen
Messages: 20
Registered: June 2010
Location: Bangalore
Junior Member
Hi cookiemonster

I created the "update Button" in form and write the code in
if :system.form_status <> 'QUERY' then

set_block_property ('well_gas_anal',insert_allowed,property_True);
set_block_property ('well_gas_anal',update_allowed,property_True);
set_block_property ('well_gas_anal',delete_allowed,property_True);
end if;

here if change anything and click "update button" not getting any error but when i tried to click the "Save Button" here getting the error "Oracle Unable to insert the Record" and "ORA-00001: unique constraint (NIMM_FCT.WELL_GAS_ANAL_PK) violated". Please help me

Cheers!
Praveen.K
Re: Unable to update the record in oracle forms [message #506814 is a reply to message #506811] Wed, 11 May 2011 06:26 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why can't you use the built-in query functionality?
Re: Unable to update the record in oracle forms [message #506817 is a reply to message #506814] Wed, 11 May 2011 06:37 Go to previous messageGo to next message
kvkpraveen
Messages: 20
Registered: June 2010
Location: Bangalore
Junior Member
Hi cookiemonster

I am new to oracle forms and requesting you to please give some example how to use built-in query functionality?

Cheers!
Praveen
Re: Unable to update the record in oracle forms [message #506822 is a reply to message #506817] Wed, 11 May 2011 06:58 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Bring up form builder help. Type query into the search field. Read all the topics.
Re: Unable to update the record in oracle forms [message #506824 is a reply to message #506817] Wed, 11 May 2011 07:02 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
kvkpraveen wrote on Wed, 11 May 2011 13:37
how to use built-in query functionality?

Create a form with help of the Data Block Wizard. Form might not look very pretty, but all built-in functionalities will be there.

Once you make a form work, you can make it fancy.
Re: Unable to update the record in oracle forms [message #506827 is a reply to message #506824] Wed, 11 May 2011 07:21 Go to previous messageGo to next message
kvkpraveen
Messages: 20
Registered: June 2010
Location: Bangalore
Junior Member
Hi cookiemonster

Could you suggest me which are the built-in are related to my issue.

Cheers
Praveen
Re: Unable to update the record in oracle forms [message #506828 is a reply to message #506709] Wed, 11 May 2011 07:23 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
cookiemonster wrote on Tue, 10 May 2011 18:56

a) use forms default query functionality (enter_query and execute_query)

Re: Unable to update the record in oracle forms [message #506854 is a reply to message #506828] Wed, 11 May 2011 08:16 Go to previous messageGo to next message
kvkpraveen
Messages: 20
Registered: June 2010
Location: Bangalore
Junior Member
Hi cookiemonster

Is there any way to pass the condition like to restrict the result in execute_query built-in.

Cheers!
Praveen
Re: Unable to update the record in oracle forms [message #506859 is a reply to message #506854] Wed, 11 May 2011 08:27 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Read up on
1)where clause
2) onetime_where
3) default_where
4) designing forms for querying
5) query processing

You need to understand how forms work before you can create them.
Re: Unable to update the record in oracle forms [message #507045 is a reply to message #506859] Thu, 12 May 2011 05:26 Go to previous messageGo to next message
jademad
Messages: 8
Registered: May 2011
Location: Bahrain
Junior Member
hello Dear,
I think that the error which raise to U:
"Oracle Unable to insert the Record" and "ORA-00001: unique constraint
it is very clear that you are trying to add a new/update record with a Unique Value which is already exist in a nother record.
check the value given to the primary key and be sure that is not exists on the table.

Re: Unable to update the record in oracle forms [message #507055 is a reply to message #506709] Thu, 12 May 2011 05:53 Go to previous message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
I've already said exactly why the error occured:

cookiemonster wrote on Tue, 10 May 2011 18:56
That would be because you are populating the block with a select statement rather than using forms query functionality.
Because of that oracle thinks the record is new one and tries to insert it rather than update it.

Previous Topic: could not reserve record(2 tries).Keep trying?
Next Topic: bypass log on screen in forms 6i
Goto Forum:
  


Current Time: Sat Sep 07 15:19:16 CDT 2024