I am trying to attempt to add the following constraints, but Oracle returns the error shown below.
Optional table Table1 ADD (contract GT_Table1_CloseDate CHECK (CloseDate & gt; SYSDATE), CONSTRAINT LT_Table1_CloseDate CHECK (CloseDate & lt; = SYSDATE + 365)), CONSTRAINT GT_Table1_StartDate CHECK (StartDate & gt; ( CloseDate + (SYSDATE + 730))); Error: error report: SQL error: ORA-02436: date or system variable wrongly specified signal barrier in 02436. 00000 - "incorrectly specified variables in date or system check barrier" * Reason: An attempt was made to use a continuous or system variable, such as USER, in a check barrier that was not specified in a full table or optional table statement, for example, a date was specified without a century was. * Action: Specify the date continuously or the system variable. Event gives 10149 allows a bug that can be set to create the first "A1", "10-Mai -96" "such as allowing obstacles, version 8. < / div>
a Czech barrier, unfortunately, the function can not reference such as SYSDATE. that you check these values when Dimel The trigger will need to be created, i.e.
create trg_check_dates before the trigger or on table 2. Update for each row IF (: new.CloseDate & lt; = SYSDATE) then RAISE_APPLICATION_ERROR (-20101, 'invalid stop date: CloseDate must be greater than the current date - value =' || to_char (: new.CloseDate, ' YYYY-MM-DD HH24: MI: SS ')); that the end; IF (: new.CloseDate & gt; add_months (SYSDATE, 12)) then RAISE_APPLICATION_ERROR (-20002,' invalid stop date: CloseDate be within the next year should - value = 'to_char (: new.CloseDate,' YYYY-MM- DD HH 24: MI: SS ')); that the end; IF (: new.StartDate & lt; = add_months (new.CloseDate, 24)) Then RAISE_APPLICATION_ERROR (-20002, 'invalid start-date: 24 months of shutting down the start date Should be within - StartDate = '|| To_char (: new.StartDate, 'YYYY-MM-DD HH24: MI: SS') || 'CloseDate =' || To_char (: new.CloseDate, 'YYYY-MM-DD HH24: MI: SS')); end if; End;
Comments
Post a Comment