如何使用 Form Builder 和 PL/SQL 插入记录?

发布于 2024-07-14 10:53:03 字数 625 浏览 6 评论 0原文

我正在慢慢学习 SQL 以及如何使用表单生成器 6。情况是我有一个名为“玩家”的简单表,表中我有三列:

  • player_no(主键)
  • 位置
  • 目标

在表单生成器 6 中我创建了一个非常使用这三个字段的简单形式。 该表格名为“团队”。 在表单的底部有一个标有“添加”的按钮。 目标是让用户输入玩家编号、位置和目标,然后单击“添加”。 然后这些信息将进入我的表格。

迄今为止所有的尝试都惨遭失败。 我已经在按钮上设置了触发器(WHEN_MOUSE_CLICK)。 然后我输入了以下代码:

BEGIN
  INSERT INTO players ( player_no )
  VALUES ( :TEAM.player_no )
END

为了测试它,我只使用了 one (player_no) 字段。 然后编译没有错误,当我运行表单并输入player_no并点击按钮时,我在状态栏中收到以下错误:

frm-40735:WHEN-MOUSE-CLICK触发器引发了未处理的异常ORA-01400

我在做什么吗大错特错了? 我对 SQL 和 Form Builder 非常陌生,因此我们将不胜感激。

I'm slowly learning SQL and how to use form builder 6. The situation is I have a simple table named 'players' within the table I have three columns:

  • player_no (primary key)
  • position
  • goals

Within form builder 6 I have created a very simple form using these three fields. The form is named 'TEAM'. At at the foot of the form I have a button labelled 'Add'. The goal is for the user to enter a player_no, position and goals and then to click 'Add'. This information is then to go into my table.

All attempts so far have failed miserably. I have set up a trigger on the button (WHEN_MOUSE_CLICK). I have then entered the following code:

BEGIN
  INSERT INTO players ( player_no )
  VALUES ( :TEAM.player_no )
END

For the purpose of testing it out I have only been using the one (player_no) field. This then compiles with no errors yet when I run the form and enter a player_no and hit the button I get the following error in the status bar:

frm-40735: WHEN-MOUSE-CLICK trigger raised unhandled exception ORA-01400

Am I doing something horribly wrong? I am very much new to SQL and Form Builder so any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冷月断魂刀 2024-07-21 10:53:03

ORA-01400:无法插入 Null 似乎您的字段之一不为空并且您在插入时省略了它们。 或值 :TEAM.player_no 在插入期间为 null。

另外,来自网络的某个地方:

FRM-40735:ON-INSERT 触发器已引发
未处理 我们也遇到过类似的问题
自 11.5.9 起。 我们清除Jinitiator
缓存和临时互联网文件
(工具>互联网选项,然后在
临时互联网文件清晰
文件按钮)。 似乎有效。

ORA-01400: cannot insert Null seems like one of your fields are not null and you omited them on insert. or value :TEAM.player_no is null during insert.

Also, somewhere from web:

FRM-40735: ON-INSERT trigger raised
unhandled We have had similar problem
since 11.5.9. We clear Jinitiator
cache, and temporary internet files
(tools>internet options then under
temporary internet files the clear
files button). Seems to work.

画尸师 2024-07-21 10:53:03

使用 Form Builder 的好处之一是您几乎总是不需要自己编写 DML 语句。

只需根据表创建块 - 然后用户可以添加和修改任意数量的记录,然后当他们保存(即提交)时,Forms 运行时会自动计算出保存更改所需的 INSERT 和 UPDATE。

One of the benefits of using Form Builder is that you almost always don't need to write the DML statements yourself.

Just make the block based on the table - then the user can add and modify as many records as they like, then when they save (i.e. COMMIT), the Forms runtime automatically works out what INSERTs and UPDATEs are required to save the changes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文