感谢到目前为止的家伙,
我觉得我在你的帮助下越走越远!
但是,当我使用 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)