Judgment method: 1. Use "desc table name" to judge in sqlplus. This statement can display the data status in the table, including the type of each column; 2. Use "select to_char(field,'yyyy- mm-dd') from table name" statement, if the result does not report an error, it means that the data is of date type.
The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.
Method 1: Run desc table name in sqlplus
The result is to see if the field is in date format date
desc +表名
Used to display the status of the table, including column name (column name), type of each column (Type), value type of each column, primary foreign key (Key)
Examples are as follows:
Input: desc xs;
Method 2: Use to_char
select to_char(字段,'yyyy-mm-dd') from 表名
If no error is reported, it is date
Examples are as follows:
Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of How does Oracle determine whether data is a date?. For more information, please follow other related articles on the PHP Chinese website!