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');)
ません。