无法插入行 [英] Unable to insert row
问题描述
我正在使用oracle 10G表单生成器(并且我没有可以使用的替代方法).我一直在尝试这段代码,但是找不到为什么它不起作用的原因.
I am using oracle 10G forms builder (and i DO NOT have an alternative that i can use). I have been trying out this code but cant find a reason why it would not work.
DECLARE
my_id att_student.studCode%TYPE;
my_fname att_student.studFname%TYPE;
my_lname att_student.studSname%TYPE;
BEGIN
my_id:=:STUDENT.STUDCODE;
my_fname:=:STUDENT.STUDFNAME;
my_lname:=:STUDENT.STUDSNAME;
INSERT into att_student
(studCode, studFname, studSname)
VALUES
(my_id,my_fname,my_lname);
commit;
message(my_fname);
END;
在哪里,
att_student是您可能已经想到的表格,
STUDENT是我的数据块的名称,
STUDCODE,STUDFNAME和STUDSNAME是文本项
错误: FRM-40508:ORACLE错误:无法插入记录
在您回覆之前,请注意:
1.我尝试使用varchar值代替变量,即我已经厌倦了
where,
att_student is a table as you may have figured,
STUDENT is the name of my data block,
STUDCODE, STUDFNAME and STUDSNAME are text items
ERROR: FRM-40508 : ORACLE error: unable to INSERT record
Before you reply, PLEASE note:
1. I have tried using varchar values instead of the variables, i.e. i have tired
INSERT into att_student
(studCode, studFname, studSname)
VALUES
('my_id','my_fname','my_lname');
并且它运行完美,这意味着在插入语句之前没有问题.
2. message(my_fname);
代码运行良好,并且显示STUDENT.STUDFNAME中的任何文本.因此,它的确设置了文本项中的值.
and it works perfectly, which means there is no problem whit the insert statement.
2. The message(my_fname);
code works well and it displays whatever text is in the STUDENT.STUDFNAME. So it does set the values from the text items.
推荐答案
Have n't曾使用这种技术了很长时间,但是您是否可以选择设置"设计表单时将数据库项添加到false
?如果您对类型有误,我认为这会有所帮助...但是正如我说的那样,在黑暗中颇为轻松
Haven''t used this technique for ages but do you have the option to set the "Database item" to false
when designing the form? I think this would help if you have a mismacth in types... But as I said, quite a shot in the dark
这篇关于无法插入行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!