到目前为止,谢谢你们,
我觉得我首先得到的是你的帮助!
但是,当我使用oracle提供的表单向导时,我现在遇到了另一个问题。
我遇到的问题是在关注向导时要求设置主键列,但是一旦我有了,我就无法添加ROWS。
要了解我的意思,这里是一个例子:
无法添加计划编号。
以下是表格的SQL:
CREATE TABLE "MACHINE_SCHEDULE"
( "SCHEDULE_NUMBER" VARCHAR2(40 CHAR),
"MACHINE_NO" VARCHAR2(10 CHAR),
"MACHINE_USE_DATE" DATE,
"START_TIME" TIMESTAMP (3) WITH TIME ZONE,
"END_TIME" TIMESTAMP (3) WITH TIME ZONE,
"PROCESS" VARCHAR2(164 CHAR),
"BATCH_NO" VARCHAR2(10 CHAR),
"MATERIAL_BAR_NO" NUMBER(8,0),
"TECHNICIAN_STAFF_NO" VARCHAR2(15 CHAR),
CONSTRAINT "MACHINE_SCHEDULE_PK" PRIMARY KEY ("SCHEDULE_NUMBER") ENABLE
)
/
ALTER TABLE "MACHINE_SCHEDULE" ADD CONSTRAINT "MACHINE_SCHEDULE_CON" FOREIGN KEY ("TECHNICIAN_STAFF_NO")
REFERENCES "MODULE_TECHNICIAN" ("TECHNICIAN_STAFF_NO") ENABLE
/
ALTER TABLE "MACHINE_SCHEDULE" ADD CONSTRAINT "MACHINE_SCHEDULE_FK" FOREIGN KEY ("BATCH_NO")
REFERENCES "BATCH" ("BATCH_NO") ENABLE
/
ALTER TABLE "MACHINE_SCHEDULE" ADD CONSTRAINT "MACHINE_SCHEDULE_FK2" FOREIGN KEY ("MATERIAL_BAR_NO")
REFERENCES "MATERIAL_BAR" ("MATERIAL_BAR_NO") ENABLE
/
CREATE OR REPLACE TRIGGER "BI_MACHINE_SCHEDULE"
before insert on "MACHINE_SCHEDULE"
for each row
begin
if :NEW."SCHEDULE_INSTANT_NUMBER" is null then
select "MACHINE_SCHEDULE_SEQ".nextval into :NEW."SCHEDULE_INSTANT_NUMBER" from dual;
end if;
end;
/
ALTER TRIGGER "BI_MACHINE_SCHEDULE" DISABLE
/
但是,当我尝试在表中添加行时,我收到错误:
Error in mru internal routine: ORA-20001: Error in MRU: row= 1,
ORA-01438: value larger than specified precision allowed for this column,
insert into "GROUP7_1"."MACHINE_SCHEDULE" ( "SCHEDULE_NUMBER", "MACHINE_NO", "MACHINE_USE_DATE", "START_TIME", "END_TIME", "PROCESS", "BATCH_NO", "MATERIAL_BAR_NO", "TECHNICIAN_STAFF_NO")
values ( :b1, :b2, :b3, :b4, :b5, :b6, :b7, :b8, :b9)