Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sql view updation in multiple tables

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have made a view from the two tables
E1 column names
e_id
e_name
E2 column names
emp_id
emp_description

create view employee (e_id,e_name, e_description)
2 as select E1.e_id, E1.e_name, E2.emp_description
3 from E1 ,E2
4 where E1.e_id = E2.emp_id ;

and trying to update in bpth the tables
update employee
2> set e_name = 'NidhiTewari'
3> and e_description = 'passion for u'
4> where e_id = 12345 ;
but giving me the error
"cannot modify a column which maps to a non key-preserved table"

please help me out
its urgent
Thanks & Regards
Nidhi Tewari
tnidhi@in.ibm.com

 
From Books Online for the Update statement:

"The view referenced by view_name must be updatable. The modifications made by the UPDATE statement cannot affect more than one of the base tables referenced in the FROM clause of the view. "
Robert Bradley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top