0

oci8安装了一个模块,在我的查询中PHP使用转换时出现错误。to_date当我在我的 sql 开发人员中使用完全相同的查询时,它工作得很好。

php:

include("db_connection.php");


$query = "select count(distinct mp_eic) kogus, asp
from tellitud_eic
where work_type in ('E63001','E90000')
and wo_issued_meter is not null
and to_date(actual_completion, 'dd.mm.yyyy hh24:mi:ss') < '01.01.2014'
group by asp";


$parseQuery = oci_parse($connection, $query);

$result = oci_execute($parseQuery);

$sqlResultJson = array();


while ($row = oci_fetch_array($parseQuery, OCI_ASSOC+OCI_RETURN_NULLS)) {
    array_push($sqlResultJson, $row);
}

$json = json_encode($sqlResultJson);

echo $json;

错误:

Warning:  oci_execute(): ORA-01843: not a valid month in <b>C:\Apache24\htdocs\queries\query_2013_installation_by_asp.php on line 15
Warning:  oci_fetch_array(): ORA-24374: define not done before fetch or execute and fetch in <b>C:\Apache24\htdocs\queries\query_2013_installation_by_asp.phpon line 
[]

我使用了另一个 to_date 格式的查询,这个查询有效,(to_date(to_char(to_date(p_kuu, 'mm'), 'MONTH'), 'MONTH');)
所以我不知道发生了什么。

4

0 回答 0