我创建的视图里面有两张表内的字段。但是往该视图中添加纪录会报一个
Error updating database. Cause: java.sql.SQLException: Can not modify more than one base table through a join view 'itswk_db.view_entity_entity_c'
The error may involve defaultParameterMap
The error occurred while setting parameters
SQL: INSERT INTO view_entity_entity_c( id, create_date, update_date, de_flag, user_id, entity_name, entity_address, entity_gps, entity_ownername, entity_cert_num, entity_cert_img1, entity_cert_img2, entity_owner_phone, entity_businessfor, entity_introduce, entity_img, entity_log, entity_mail_hr, entity_phone_hr, entity_web, login_name, user_name, user_email, user_phone, user_mobile, user_photo ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
Cause: java.sql.SQLException: Can not modify more than one base table through a join view 'itswk_db.view_entity_entity_c'
; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1393]; Can not modify more than one base table through a join view 'itswk_db.view_entity_entity_c'; nested exception is java.sql.SQLException: Can not modify more than one base table through a join view 'itswk_db.view_entity_enti
这是什么原因造成的。。怎么解决。谢谢大家
视图只是一个查询的集合,显然是不能通过视图修改多张基表的,并不能往视图中插入数据或者修改数据,只能往对应的基表中插入数据。
不能通过视图来修改多张基本表,但如果是行列子集视图(即改视图仅依赖于一个基本表的情况),是可以的
受教了