Using dateTime and TIMESTAMP
407231Nov 20 2003 — edited Nov 24 2003Hello,
I've created and registered a XML Schema containing timestamp elements:
...
<xs:element name="CREATED" type="xs:dateTime" xdb:SQLName="CREATED" xdb:JavaType="TimeStamp"/>
...
I'm using this statement to register the Schema:
BEGIN
DBMS_XMLSCHEMA.REGISTERSCHEMA(schemaurl=>'http://xmlns.lincas.de/leasy/txb.xsd', schemadoc=>sys.UriFactory.getUri('/leasy/txb.xsd'), local=>TRUE, gentypes=>TRUE, genbean=>FALSE, gentables=>FALSE, force=>FALSE);
END;
/
This will create the required object type (gentypes=>TRUE). Using this object type to create a table will always create columns TIMESTAMP(0):
-- Create table TXB, add primary key constraint and create indices
CREATE TABLE TXB OF LX_TXB_COLUMNS
(ID NOT NULL, CREATED DEFAULT systimestamp NOT NULL, CREATED_BY NOT NULL, MODIFIED DEFAULT systimestamp NOT NULL, MODIFIED_BY NOT NULL, VERSION DEFAULT 0 NOT NULL, DATA_TYPE NOT NULL, DATA_LENGTH NOT NULL, DATA NOT NULL, PK_TXB NOT NULL)
TABLESPACE LINDBDYN;
How can I define the "digits" or "fraction" of a TIMESTAMP, e.g. to use always TIMESTAMP(3)?
Thanks in advance
Stephan