疯狂刘备 2016-07-25 06:23 采纳率: 33.3%
浏览 3632

MYsql能否通过视图修改多张基表

我创建的视图里面有两张表内的字段。但是往该视图中添加纪录会报一个

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

这是什么原因造成的。。怎么解决。谢谢大家

  • 写回答

3条回答

  • blue小脚丫 2016-07-25 08:16
    关注

    视图只是一个查询的集合,显然是不能通过视图修改多张基表的,并不能往视图中插入数据或者修改数据,只能往对应的基表中插入数据。

    评论

报告相同问题?

悬赏问题

  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3