The database representation and validation for XML Schema datatypes is affected by using Oracle8i. In particular, the normalizedString datatype and all the subtypes derived by restriction are affected, as well as the time datatype, dateTime datatype, date datatype, gMonth datatype, gYear datatype, gYearMonth datatype, gDay datatype, and gMonthDay datatype. gMonth, gYear, and gDay are unaffected if time-zone offsets are not required, because they can simply be represented as positiveInteger datatypes with minInclusive and maxInclusive facet restrictions. Refer to Section 22.4.37 for more information about the need to implement time-zone offsets.
Each of these XML Schema datatypes is discussed in this section, with various implementation options, when applicable.
Without the support for Unicode strings in Oracle9i, the PL/SQL function UNISTR is not implemented. To validate that a set of characters is a normalizedString datatype, the CHR function must be used instead. Unfortunately, the CHR function is based on the type of machine used (ASCII, EBCDIC, and so on) and on the character set defined for the database. Listing D.1 iterates Listing 22.10 in Oracle9i, and Listing D.2 maps it to Oracle8i when the character set is defined as ‘WE8ISO8859P1’.
CREATE TABLE NormalizedStringExample ( value VARCHAR2(30) CHECK (INSTR(value, UNISTR(' 00D')) = 0 AND INSTR(value, UNISTR(' 00A')) = 0 AND INSTR(value, UNISTR(' 009')) = 0) ); |
CREATE TABLE NormalizedStringExample ( value VARCHAR2(30) CHECK (INSTR(value, CHR(13)) = 0 AND INSTR(value, CHR(10)) = 0 AND INSTR(value, CHR(9)) = 0) ); |
Without native time-zone support, the XML Schema dateTime datatype can be represented as a database DATE column datatype with an INTERVAL offset. This does not maintain the time zone of the original dateTime value. Listing D.3 implements a dateTime datatype table creation.
CREATE TABLE DateTimeExample ( value DATE ); |
To insert a row into the table with a dateTime datatype, Oracle needs to convert a value from its ISO 8601 standard format to an internal Oracle representation. Listing D.4 is a SQL statement that inserts a dateTime value into the DateTimeExample table excluding offsetting for the time-zone indicator. When the SQL executes, the ?datetimeValue bind variable is the dateTime value.
INSERT INTO DateTimeExample (value) SELECT TO_DATE(SUBSTR(?datetimeValue, 1, 19), 'YYYY-MM-DD"T"HH24:MI:SS') FROM dual; |
Listing D.5 is a SQL statement that inserts a dateTime into the DateTimeExample table, including the offset for the time-zone indicator. When the SQL executes, the ?timeZoneSign bind variable is the twentieth character in a dateTime value, the ?datetimeValue bind variable is the first 19 characters in a dateTime value, and the ?timeZone bind variable is the last 4 characters in a dateTime value.
INSERT INTO DateTimeExample (value) SELECT (CASE WHEN ?timeZoneSign= '-' THEN TO_DATE(?datetimeValue, 'YYYY-MM-DD"T"HH24:MI:SS') - INTERVAL ?timeZone HOUR TO MINUTE ELSE TO_DATE(?datetimeValue, 'YYYY-MM-DD"T"HH24:MI:SS') + INTERVAL ?timeZone HOUR TO MINUTE END) FROM dual; |
Listing D.6 is a SQL statement that retrieves all of the values from the DateTimeExample table.
SELECT TO_CHAR(value, 'YYYY-MM-DD"T"HH24:MI:SS') FROM DateTimeExample; |
There is no built-in database support for the maxInclusive constraining facet, but Listing D.7 shows how this can be enforced as a column constraint.
CREATE TABLE DatetimeMaxInclusiveExample ( value DATE CHECK (value <= TO_DATE('2001-12-24T12:23:45', 'YYYY-MM-DD"T"HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the maxExclusive constraining facet, but Listing D.8 shows how this can be enforced as a column constraint.
CREATE TABLE DatetimeMaxExclusiveExample ( value DATE CHECK (value < TO_DATE('2001-12-24T12:23:45', 'YYYY-MM-DD"T"HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minInclusive constraining facet, but Listing D.9 shows how this can be enforced as a column constraint.
CREATE TABLE DatetimeMinInclusiveExample ( value DATE CHECK (value >= TO_DATE('2001-12-24T12:23:45', 'YYYY-MM-DD"T"HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minExclusive constraining facet, but Listing D.10 shows how this can be enforced as a column constraint.
CREATE TABLE DatetimeMinExclusiveExample ( value DATE CHECK (value > TO_DATE('2001-12-24T12:23:45', 'YYYY-MM-DD"T"HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
Without native time-zone support, the XML Schema date datatype can be represented as a database DATE column datatype with an INTERVAL offset. This does not maintain the time-zone of the original date value. Listing D.11 implements a date datatype table creation.
CREATE TABLE DateExample ( value DATE ); |
To insert a row into the table with a date datatype, Oracle needs to convert a value from its ISO 8601 standard format to an internal Oracle representation. Listing D.12 is a SQL statement that inserts a date into the DateExample table, excluding offsetting for the time-zone indicator. When the SQL executes, the ?dateValue bind variable is the date value.
INSERT INTO DateExample (value) SELECT TO_DATE(SUBSTR(?dateValue, 1, 10), 'YYYY-MM-DD') FROM dual; |
Listing D.13 is a SQL statement that inserts a date into the DateExample table, including the offset for the time-zone indicator. When the SQL executes, the ?timeZoneSign bind variable is the eleventh character in a date value, the ?dateValue bind variable is the first 10 characters in a date value, and the ?timeZone bind variable is the last 4 characters in a date value.
INSERT INTO DateExample (value) SELECT (CASE WHEN ?timeZoneSign= '-' THEN TO_DATE(?dateValue, 'YYYY-MM-DD') - INTERVAL ?timeZone HOUR TO MINUTE ELSE TO_DATE(?dateValue, 'YYYY-MM-DD') + INTERVAL ?timeZone HOUR TO MINUTE END) FROM dual; |
Listing D.14 is a SQL statement that retrieves of the values from the DateExample table.
SELECT TO_CHAR(value, 'YYYY-MM-DD"T"HH24:MI:SS') FROM DateTimeExample; |
There is no built-in database support for the maxInclusive constraining facet, but Listing D.15 shows how this can be enforced as a column constraint.
CREATE TABLE DateMaxInclusiveExample ( value DATE CHECK (value <= TO_DATE('2001-12-24T12:23:45', 'YYYY-MM-DD"T"HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the maxExclusive constraining facet, but Listing D.16 shows how this can be enforced as a column constraint.
CREATE TABLE DateMaxExclusiveExample ( value DATE CHECK (value < TO_DATE('2001-12-24T12:23:45', 'YYYY-MM-DD"T"HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minInclusive constraining facet, but Listing D.17 shows how this can be enforced as a column constraint.
CREATE TABLE DateMinInclusiveExample ( value DATE CHECK (value >= TO_DATE('2001-12-24T12:23:45', 'YYYY-MM-DD"T"HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minExclusive constraining facet, but Listing D.18 shows how this can be enforced as a column constraint.
CREATE TABLE DateMinExclusiveExample ( value DATE CHECK (value > TO_DATE('2001-12-24T12:23:45', 'YYYY-MM-DD"T"HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
Without native time-zone support, the gYear datatype can be represented as a DATE column datatype with an INTERVAL offset. This does not maintain the time zone of the original gYear value. Listing D.19 implements a gYear table creation.
CREATE TABLE GYearExample ( value DATE ); |
To insert a row into the table with a gYear datatype, Oracle needs to convert a value from its XML Schema format to an internal Oracle representation. Listing D.20 is a SQL statement that inserts a gYear into the GYearExample table. When the SQL executes, the ?timeZoneSign bind variable is the third character in a gYear value, the ?gYearValue bind variable is the first 4 characters in a gYear value, and the ?timeZone bind variable is the last 4 characters in a gYear value. Note that when a month is not specified, Oracle chooses the current month. However, Oracle defaults to the first day of the month if the day is not specified.
INSERT INTO gYearExample SELECT (CASE WHEN ?timeZoneSign= '-' THEN TO_DATE(?gYearValue || '-01', 'YYYY-MM') - INTERVAL ?timeZone HOUR TO MINUTE ELSE TO_DATE(?gYearValue || '-01', 'YYYY-MM') + INTERVAL ?timeZone HOUR TO MINUTE END) FROM dual; |
Listing D.21 is a SQL statement that retrieves of the values from the GYearExample table.
SELECT TO_CHAR(value, 'IYYY-MM-DD"T"HH24:MI:SS') FROM GYearExample; |
There is no built-in database support for the maxInclusive constraining facet, but Listing D.22 shows how this can be enforced as a column constraint.
CREATE TABLE GYearMaxInclusiveExample ( value DATE CHECK (value <= TO_DATE(1999 || '-01', 'YYYY-MM') - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the maxExclusive constraining facet, but Listing D.23 shows how this can be enforced as a column constraint.
CREATE TABLE GYearMaxExclusiveExample ( value DATE CHECK (value < TO_DATE(1999 || '-01', 'YYYY-MM') - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minInclusive constraining facet, but Listing D.24 shows how this can be enforced as a column constraint.
CREATE TABLE GYearMinInclusiveExample ( value DATE CHECK (value >= TO_DATE(1999 || '-01', 'YYYY-MM') - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minExclusive constraining facet, but Listing D.25 shows how this can be enforced as a column constraint.
CREATE TABLE GYearMinExclusiveExample ( value DATE CHECK (value > TO_DATE(1999 || '-01', 'YYYY-MM') - INTERVAL '05:00' HOUR TO MINUTE) ); |
Without native time-zone support, the gYearMonth datatype can be represented as a DATE column datatype with an INTERVAL offset. This does not maintain the time zone of the original gYearMonth value. Listing D.26 implements a gYearMonth table creation.
CREATE TABLE GYearMonthExample ( value DATE ); |
To insert a row into the table with a gYearMonth datatype, Oracle needs to convert a value from its ISO 8601 standard format to an internal Oracle representation. Listing D.27 inserts a gYearMonth into the GYearMonthExample table, excluding offsetting for the time-zone indicator. When the SQL executes, the ?gYearMonthValue bind variable is the gYearMonth value.
INSERT INTO GYearMonthExample (value) SELECT TO_DATE(SUBSTR(?gYearMonthValue, 1, 7), 'YYYY-MM') FROM dual; |
Listing D.28 inserts a gYearMonth into the GYearMonthExample table, including the offset for the time-zone indicator. When the SQL executes, the ?timeZoneSign bind variable is the eighth character in a gYearMonth value, the ?gYearMonthValue bind variable is the first 7 characters in a gYearMonth value, and the ?timeZone bind variable is the last 4 characters in a gYearMonth value.
INSERT INTO GYearMonthExample SELECT (CASE WHEN ?timeZoneSign= '-' THEN TO_DATE(?gYearMonthValue, 'YYYY-MM') - INTERVAL ?timeZone HOUR TO MINUTE ELSE TO_DATE(?gYearMonthValue, 'YYYY-MM') + INTERVAL ?timeZone HOUR TO MINUTE END) FROM dual; |
To insert a row into the table with a gYearMonth datatype, Oracle needs to convert a value from its XML Schema format to an internal Oracle representation. Listing D.29 is a SQL statement that inserts a gYearMonth into the GYearMonthExample table.
INSERT INTO GYearMonthExample SELECT (CASE WHEN ?timeZoneSign= '-' THEN TO_DATE(?gYearMonthValue, 'YYYY-MM') - INTERVAL ?timeZone HOUR TO MINUTE ELSE TO_DATE(?gYearMonthValue, 'YYYY-MM') + INTERVAL ?timeZone HOUR TO MINUTE END) FROM dual; |
Listing D.30 is a SQL statement that retrieves all of the values from the GYearMonthExample table.
SELECT TO_CHAR(value, 'IYYY-MM-DD"T"HH24:MI:SS') FROM GYearMonthExample; |
There is no built-in database support for the maxInclusive constraining facet, but Listing D.31 shows how this can be enforced as a column constraint.
CREATE TABLE GYearMonthMaxInclusiveExample ( value DATE CHECK (value <= TO_DATE('2001-12', 'YYYY-MM') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the maxExclusive constraining facet, but Listing D.32 shows how this can be enforced as a column constraint.
CREATE TABLE GYearMonthMaxExclusiveExample ( value DATE CHECK (value < TO_DATE('2001-12', 'YYYY-MM') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minInclusive constraining facet, but Listing D.33 shows how this can be enforced as a column constraint.
CREATE TABLE GYearMonthMinInclusiveExample ( value DATE CHECK (value >= TO_DATE('2001-12', 'YYYY-MM') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minExclusive constraining facet, but Listing D.34 shows how this can be enforced as a column constraint.
CREATE TABLE GYearMonthMinExclusiveExample ( value DATE CHECK (value > TO_DATE('2001-12', 'YYYY-MM') + INTERVAL '05:00' HOUR TO MINUTE) ); |
Without native time-zone support, the XML Schema time datatype can be represented as a database DATE column datatype with an INTERVAL offset. This does not maintain the time zone of the original time value. Listing D.35 implements a time datatype table creation.
CREATE TABLE TimeExample ( value DATE ); |
To insert a row into the table with a time datatype, Oracle needs to convert a value from its XML Schema format to an internal Oracle representation. In addition, because Oracle needs a date for the insert, it is appropriate to use a date that indicates that no date was specified. Oracle has a minimum date of January 1, 4712 B.C. It is represented by the number 1 and is translated into January 1, 4712 B.C. by the ‘J’ datetime format element. A hard-coded date is especially useful when min/max inclusion/exclusion facets have been specified. Listing D.36 is a SQL statement that inserts a time into the TimeExample table, excluding offsetting for the time-zone indicator. When the SQL executes, the ?timeValue bind variable is the time value.
INSERT INTO TimeExample (value) SELECT TO_DATE('1 ' || SUBSTR(?timeValue, 1, 8), 'J HH24:MI:SS') FROM dual; |
Listing D.37 is a SQL statement that inserts a time into the TimeExample table, including the offset for the time-zone indicator. When the SQL executes, the ?timeZoneSign bind variable is the ninth character in a time value, the ?timeValue bind variable is the first 8 characters in a time value, and the ?timeZone bind variable is the last 4 characters in a time value.
INSERT INTO TimeExample (value) SELECT (CASE WHEN ?timeZoneSign = '-' THEN TO_DATE('1 ' || ?timeValue, 'J HH24:MI:SS') - INTERVAL ?timeZone HOUR TO MINUTE ELSE TO_DATE('1 ' || ?timeValue, 'J HH24:MI:SS') + INTERVAL ?timeZone HOUR TO MINUTE END) FROM dual; |
Listing D.38 is a SQL statement that retrieves all of the values from the TimeExample table.
SELECT TO_CHAR(value, 'HH24:MI:SS') FROM TimeExample; |
There is no built-in database support for the maxInclusive constraining facet, but Listing D.39 shows how this can be enforced as a column constraint.
CREATE TABLE TimeMaxInclusiveExample ( value DATE CHECK (value <= TO_DATE('1 12:45:30', 'J HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the maxExclusive constraining facet, but Listing D.40 shows how this can be enforced as a column constraint.
CREATE TABLE TimeMaxExclusiveExample ( value DATE CHECK (value < TO_DATE('1 12:45:30', 'J HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minInclusive constraining facet, but Listing D.41 shows how this can be enforced as a column constraint.
CREATE TABLE TimeMinInclusiveExample ( value DATE CHECK (value >= TO_DATE('1 12:45:30', 'J HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minExclusive constraining facet, but Listing D.42 shows how this can be enforced as a column constraint.
CREATE TABLE TimeMinExclusiveExample ( value DATE CHECK (value > TO_DATE('1 12:45:30', 'J HH24:MI:SS') + INTERVAL '05:00' HOUR TO MINUTE) ); |
Without native time-zone support, the XML Schema gMonth datatype can be represented as a database DATE column datatype with an INTERVAL offset. This does not maintain the time zone of the original gMonth value. Listing D.43 implements a gMonth table creation.
CREATE TABLE GMonthExample ( value DATE ); |
To insert a row into the table with a gMonth datatype, Oracle needs to convert a value from its XML Schema format to an internal Oracle representation. Listing D.44 is a SQL statement that inserts a gMonth into the GMonthExample table. When the SQL executes, the ?timeZoneSign bind variable is the third character in a gMonth value, the ?gMonthValue bind variable is the first 2 characters in a gMonth value, and the ?timeZone bind variable is the last 4 characters in a gMonth value.
INSERT INTO gMonthExample SELECT (CASE WHEN ?timeZoneSign= '-' THEN ADD_MONTHS(TO_DATE('1', 'J'), ?gMonthValue - 1) - INTERVAL ?timeZone HOUR TO MINUTE ELSE ADD_MONTHS(TO_DATE('1', 'J'), ?gMonthValue - 1) + INTERVAL ?timeZone HOUR TO MINUTE END) FROM dual; |
Listing D.45 is a SQL statement that retrieves of the values from the GMonthExample table.
SELECT TO_CHAR(value, 'IYYY-MM-DD"T"HH24:MI:SS') FROM GMonthExample; |
There is no built-in database support for the maxInclusive constraining facet, but Listing D.46 shows how this can be enforced as a column constraint.
CREATE TABLE GMonthMaxInclusiveExample ( value DATE CHECK (value <= ADD_MONTHS(TO_DATE('1', 'J'), 10) - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the maxExclusive constraining facet, but Listing D.47 shows how this can be enforced as a column constraint.
CREATE TABLE GMonthMaxExclusiveExample ( value DATE CHECK (value < ADD_MONTHS(TO_DATE('1', 'J'), 10) - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minInclusive constraining facet, but Listing D.48 shows how this can be enforced as a column constraint.
CREATE TABLE GMonthMinInclusiveExample ( value DATE CHECK (value >= ADD_MONTHS(TO_DATE('1', 'J'), 10) - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minExclusive constraining facet, but Listing D.49 shows how this can be enforced as a column constraint.
CREATE TABLE GMonthMinExclusiveExample ( value DATE CHECK (value > ADD_MONTHS(TO_DATE('1', 'J'), 10) - INTERVAL '05:00' HOUR TO MINUTE) ); |
Without native time-zone support, the gDay datatype can be represented as a DATE column datatype with an INTERVAL offset. This does not maintain the time zone of the original gDay value. Listing D.50 implements a gDay table creation.
CREATE TABLE GDayExample ( value DATE ); |
To insert a row into the table with a gDay datatype, Oracle needs to convert a value from its XML Schema format to an internal Oracle representation. Listing D.51 is a SQL statement that inserts a gDay into the GDayExample table. When the SQL executes, the ?timeZoneSign bind variable is the sixth character in a gDay value, the ?gDayValue bind variable is the fourth and fifth characters in a gDay value, and the ?timeZone bind variable is the last 4 characters in a gDay value.
INSERT INTO gDayExample SELECT (CASE WHEN ?timeZoneSign= '-' THEN TO_DATE('1', 'J') + ?gDayValue - INTERVAL ?timeZone HOUR TO MINUTE ELSE TO_DATE('1', 'J') + ?gDayValue + INTERVAL ?timeZone HOUR TO MINUTE END) FROM dual; |
Listing D.52 is a SQL statement that retrieves all of the values from the GDayExample table.
SELECT TO_CHAR(value, 'IYYY-MM-DD"T"HH24:MI:SS') FROM GDayExample; |
There is no built-in database support for the maxInclusive constraining facet, but Listing D.53 shows how this can be enforced as a column constraint.
CREATE TABLE GDayMaxInclusiveExample ( value DATE CHECK (value <= TO_DATE('1', 'J') + 5 - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the maxExclusive constraining facet, but Listing D.54 shows how this can be enforced as a column constraint.
CREATE TABLE GDayMaxExclusiveExample ( value DATE CHECK (value < TO_DATE('1', 'J') + 5 - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minInclusive constraining facet, but Listing D.55 shows how this can be enforced as a column constraint.
CREATE TABLE GDayMinInclusiveExample ( value DATE CHECK (value >= TO_DATE('1', 'J') + 5 - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minExclusive constraining facet, but Listing D.56 shows how this can be enforced as a column constraint.
CREATE TABLE GDayMinExclusiveExample ( value DATE CHECK (value > TO_DATE('1', 'J') + 5 - INTERVAL '05:00' HOUR TO MINUTE) ); |
Without native time-zone support, the gMonthDay datatype can be represented as a DATE column datatype with an INTERVAL offset. This does not maintain the time zone of the original gMonthDay value. Listing D.57 implements a gMonthDay table creation.
CREATE TABLE GMonthDayExample ( value DATE ); |
To insert a row into the table with a gMonthDay datatype, Oracle needs to convert a value from its XML Schema format to an internal Oracle representation. Listing D.58 is a SQL statement that inserts a gMonthDay into the GMonthDayExample table. When the SQL executes, the ?timeZoneSign bind variable is the eighth character in a GMonthDay value, the ?GMonthDayValue bind variable is the first 7 characters in a GMonthDay value, and the ?timeZone bind variable is the last 4 characters in a GMonthDay value.
INSERT INTO GMonthDayExample SELECT (CASE WHEN ?timeZoneSign = '-' THEN ADD_MONTHS(TO_DATE('1', 'J'), SUBSTR(?GMonthDayValue, 3, 2) - 1) + SUBSTR(?GMonthDayValue, 6, 2) - INTERVAL ?timeZone HOUR TO MINUTE ELSE ADD_MONTHS(TO_DATE('1', 'J'), SUBSTR(?GMonthDayValue, 3, 2) - 1) + SUBSTR(?GMonthDayValue, 6, 2) + INTERVAL ?timeZone HOUR TO MINUTE END) FROM dual; |
Listing D.59 is a SQL statement that retrieves of the values from the GMonthDayExample table.
SELECT TO_CHAR(value, 'IYYY-MM-DD"T"HH24:MI:SS') FROM GMonthDayExample; |
There is no built-in database support for the maxInclusive constraining facet, but Listing D.60 shows how this can be enforced as a column constraint.
CREATE TABLE GMonthDayMaxInclusiveExample ( value DATE CHECK (value <= TO_DATE('1', 'J') + 5 - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the maxExclusive constraining facet, but Listing D.61 shows how this can be enforced as a column constraint.
CREATE TABLE GMonthDayMaxExclusiveExample ( value DATE CHECK (value < ADD_MONTHS(TO_DATE('1', 'J'), 5) + 5 - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minInclusive constraining facet, but Listing D.62 shows how this can be enforced as a column constraint.
CREATE TABLE GMonthDayMinInclusiveExample ( value DATE CHECK (value >= ADD_MONTHS(TO_DATE('1', 'J'), 5) + 5 - INTERVAL '05:00' HOUR TO MINUTE) ); |
There is no built-in database support for the minExclusive constraining facet, but Listing D.63 shows how this can be enforced as a column constraint.
CREATE TABLE GMonthDayMinExclusiveExample ( value DATE CHECK (value > ADD_MONTHS(TO_DATE('1', 'J'), 5) + 5 - INTERVAL '05:00' HOUR TO MINUTE) ); |
18.223.196.211