Home » Developer & Programmer » Forms » Cannot Update data in the form 6i
Cannot Update data in the form 6i [message #77987] Sat, 29 December 2001 20:08 Go to next message
Neena
Messages: 2
Registered: December 2001
Junior Member
I'm new to Developer
I have created a form by using Block,Form wizard
employee1 is a name of my datablock that is linked to EMPLOYEE table
employee_id, name and position are my text items on the form
====================================
The update button has been added (PL/SQL)
==========================================
update employee
set
name = :employee1.name
where
employee_id = :employee1.employee_id
;
==================================
On runtime
The value "123" is put into Employee_id field for testing
After I click the update button
The error happens like "cannot insert the record"..
when i press shift -f1
it shows error of my sql command like
INSERT INTO EMPLOYEE(POSITION,NAME,EMPLOYEE_ID) VALUES (:1,:2,:3)
I'm wondering that The code in my pl/sql is exactly
update as mentioned but ... how it turns to be insert into ????
It seems that this query has overided my written query at all.
Is there anyone who can clarify this problem to me??
Thank you very much

----------------------------------------------------------------------
Re: Cannot Update data in the form 6i [message #77988 is a reply to message #77987] Sun, 30 December 2001 10:17 Go to previous messageGo to next message
sokeh
Messages: 77
Registered: August 2000
Member
why don't you try updating the name instead?
update employee
set
name = nvl(:employee1.name,'~')
where
employee_id = :employee1.employee_id;
then test by inserting something like "sokeh" instead of numeric "123".
I don't see why this won't work.

----------------------------------------------------------------------
Re: Cannot Update data in the form 6i [message #78016 is a reply to message #77987] Thu, 03 January 2002 20:40 Go to previous message
rama krishna
Messages: 97
Registered: December 2001
Member
hi neena,
what ever u type in the text items of base table block will be treated as new items and forms will try to insert those records into the base table. for this what u can do is, use the toolbars
enter-query option, click on it, enter what ever value u want to query (for example employee id 123 in employee id text item) and use execute-query button. this will fetch records for employee 123. now u can update whatever value u want and say save. this will work for u, no need to write update statement.

bye
ram

----------------------------------------------------------------------
Previous Topic: how can i change the order by of a report from form builder
Next Topic: very urgency
Goto Forum:
  


Current Time: Fri Apr 19 13:15:45 CDT 2024