插入视图时出现问题 [英] Problem inserting into a view

查看:74
本文介绍了插入视图时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我从我的数据库中的表员工创建了一个视图。视图是sucuessfully创建的,当我将数据插入到employee表中时,它也在视图中更新,但我尝试将数据插入到我的视图中,但它显示错误。

Hi all,
I had created a view from a table employee from my database. View is created sucuessfully and when i inserted data into employee table it is also updated in the view but i tried to insert data into my view but it shows an error.

展开 | 选择 | Wrap | 行号

推荐答案


大家好,

我从一个表员工创建了一个视图我的数据库。视图是sucuessfully创建的,当我将数据插入到employee表中时,它也在视图中更新,但我尝试将数据插入到我的视图中,但它显示错误。
Hi all,
I had created a view from a table employee from my database. View is created sucuessfully and when i inserted data into employee table it is also updated in the view but i tried to insert data into my view but it shows an error.
展开 | 选择 | Wrap | 行号



在此视图上写入INSTEAD OF TRIGGER并将记录插入触发器
Write an INSTEAD OF TRIGGER on this view and insert the record in to table emp in the trigger

中的表emp中

您好amitpatel,

感谢您的快速回复,但可以通过示例详细解释我。

如果您喜欢这样,那就太好了给我一点......请帮帮我......


Hi amitpatel,
Thanks for quick reply but can explain me in detail with example.
If u do like that it would be very helpful for me...... Please help me.....



您好amitpatel,

感谢您的快速回复,但可以通过示例详细解释我。

如果你喜欢这样对我有用......请帮帮我......
Hi amitpatel,
Thanks for quick reply but can explain me in detail with example.
If u do like that it would be very helpful for me...... Please help me.....



检查在Postgresql中编写触发器这里


所以你可以为视图实现一个ON INSERT DO INSTEAD,然后将数据插入到基表中视图是基于。您可以在我提供的链接中查找ON INSERT DO INSTEAD规则的LOGIC。

尝试后发表您的评论。


谢谢

Amit


Check about writing Triggers in Postgresql here

So you can implement a rulw ON INSERT DO INSTEAD for a view and then INSERT the data into the base table on which the view is based.You can look for LOGIC of ON INSERT DO INSTEAD rule in the link that I have provided.
DO POST your comments after trying this.

Thanks
Amit


这篇关于插入视图时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆