You can use the double colon operator (::) to cast GeoTimeRange values to a specific precision. This allows you to specify a less precise input specification than the GL_DATETIME setting. It does not, however, override the GL_DATETIME setting, nor does it extend text input.
In the following example, GL_DATETIME is set to YEAR TO DAY, and the DATETIME cast allows you to specify a GeoTimeRange value with a precision less than the minimum default of YEAR TO SECOND:
-- GL_DATETIME="%Y-%m-%d" INSERT INTO trtab VALUES (GeoTimeRange('1997-01-02'::datetime year to day)); SELECT * FROM trtab; tr (1997-01-02,1997-01-02)
In the following example, the cast allows you to specify less than the GL_DATETIME precision:
-- GL_DATETIME="%Y-%m-%d %H:%M:%S" INSERT INTO trtab VALUES (GeoTimeRange('1997-01-02'::datetime year to day)); SELECT * FROM trtab; tr (1997-01-02 00:00:00,1997-01-02 00:00:00)
The data, however, is zero-extended on input and output to YEAR TO SECOND.
In the following example, the INSERT statement returns an error message because the cast is to YEAR TO DAY, while YEAR TO SECOND data is inserted:
-- GL_DATETIME="%Y-%m-%d %H:%M:%S" INSERT INTO trtab VALUES (GeoTimeRange('1997-01-02 03:04:05'::datetime year to day)); SELECT * FROM trtab; 1264: Extra characters at the end of a datetime or interval.
http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.geod.doc/geod55.htm
'Informix > informix reference' 카테고리의 다른 글
인포믹스에서 greatest 함수 구현 (0) | 2012.04.06 |
---|---|
URL format for IBM Data Server Driver for JDBC type 4 connectivity (0) | 2012.03.28 |
Help with multibyte locales (0) | 2012.02.12 |
How to set optimal physical log size (0) | 2011.12.09 |
How to prevent the startup of the scheduler threads (0) | 2011.12.08 |