如何插入记录? [英] How Can I Insert Records?

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

问题描述

在图书馆管理系统中,

i有stud_reg注册表,我给出了stud_id字段的主键,如果学生注册的主键是启动,我还有另一个表,如book_issue和stud_tab 。在book_issue表中有stud_id的字段,我给外键和存储书发行交易的记录。在stud_tab中有stud_id字段,我给外键;存储所有信息,例如stud_id,book_id,book_name,issue_date,return_date以及如果延迟传递,则存在其中的精细字段。现在,例如学生想要软件工程书并点击发布按钮而不是记录插入但是,有错误:外键约束你不添加或更新从子到父的任何记录。这没关系,但是,对于特定学生的书,我该怎么办?有任何方法可以发布和插入记录。谢谢回复..............

In library management system,
i have stud_reg table of registration, which i give primary key of stud_id field, if student registered than the primary key is start, and i have another tables like book_issue and stud_tab. In book_issue table has fields of stud_id which i give foreign key and store records of book issue transactions. In stud_tab has field of stud_id which i give foreign key ; store all information like, stud_id, book_id,book_name, issue_date, return_date and if late deliver than fine field in it. now, e.g. student want software engineering book and click on issue button than records will inserted but, there is error: foreign key constraint that u don't add or update any records from child to parent. this ok, but, what can i do for issue that book to particular student? there is any way to issue and insert records. thanks for reply..............

推荐答案

您还没有发布任何代码,但根据这些信息,它似乎book id已在此表中设置为外键,'books'表中没有您要插入的id。在插入库事务表之前确保该书存在。
You have not posted any code, but based on this information, it appears that the book id has been setup as a foreign key in this table and the 'books' table does not have the id you are trying to insert. Make sure the book exists before inserting into the library transaction tables.


这篇关于如何插入记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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