Oracle 插入语句不';我无法识别可变值

Oracle 插入语句不';我无法识别可变值,oracle,oracle10g,oracleforms,Oracle,Oracle10g,Oracleforms,软件包上的代码工作正常。从oracle表单中,我尝试将新条目插入表中 错误消息 ORA-01400:无法将NULL插入(“总线”“BP\U验证码”“代码”) 代码 恐怕你弄错了: v_auth_code := CG$BP_AUTH_CODE.make_auth_code; --Error happening over here insert into bp_auth_code (bn, code) values(v_bn, v_auth_code); commit; message(v_auth

软件包上的代码工作正常。从oracle表单中,我尝试将新条目插入表中

错误消息

ORA-01400:无法将NULL插入(“总线”“BP\U验证码”“代码”)

代码


恐怕你弄错了:

v_auth_code := CG$BP_AUTH_CODE.make_auth_code;
--Error happening over here
insert into bp_auth_code (bn, code) values(v_bn, v_auth_code);
commit;
message(v_auth_code); -- I can see the value
说“你能看到价值”-不,你不能

如果插入失败,Oracle将引发ORA-01400错误,从而停止执行。执行
INSERT
后面的任何操作,包括
消息
调用。你不可能知道它的价值,但是——如果我是你,我会相信甲骨文。如果它说
code
为空,则为空

根据您使用的表单版本,您可以(始终)将代码(用于调试目的)重写为


或者在调试模式下运行表单(别忘了设置断点!)并跟踪其执行情况。

是否有触发器将相同的值复制到具有相同名称、不同模式(总线)的表中。我的意思是,您确定您的表单在运行时连接到
总线
模式吗?
v_auth_code := CG$BP_AUTH_CODE.make_auth_code;
--Error happening over here
insert into bp_auth_code (bn, code) values(v_bn, v_auth_code);
commit;
message(v_auth_code); -- I can see the value
v_auth_code := CG$BP_AUTH_CODE.make_auth_code;
message(v_auth_code);             -- now you'll see the V_AUTH_CODE value
insert into bp_auth_code (bn, code) values(v_bn, v_auth_code);
commit;