📜  oci_execute(): ORA-01810: 格式代码出现两次 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:11.730000             🧑  作者: Mango

代码示例1
//Using oci8 to connect to Oracle Database.
//oci_execute(): ORA-01810: format code appears twice 

SQL> SELECT  TO_TIMESTAMP('20151206 00:00:00', 'yyyy/mm/dd hh:mm:ss') FROM dual;
SELECT  TO_TIMESTAMP('20151206 00:00:00', 'yyyy/mm/dd hh:mm:ss') FROM dual
                                          *
ERROR at line 1:
ORA-01810: format code appears twice
  
//Reason for error is that 'mm' appear in ('yyyymmdd') and ('hh:mm:ss') while 
//minutes are denoted as 'mi and 'mm' as months.