Bug #74195 [Opn]: OCI_BIND_BY_NAME dates problem
| From: | wgizynski at gmail dot com | Date: | Thu, 02 Mar 2017 11:24:10 +0000 |
| Subject: | Bug #74195 [Opn]: OCI_BIND_BY_NAME dates problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207658@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74195&edit=1
ID: 74195
User updated by: wgizynski at gmail dot com
Reported by: wgizynski at gmail dot com
Summary: OCI_BIND_BY_NAME dates problem
Status: Open
Type: Bug
Package: PDO OCI
Operating System: Windows2008 server
PHP Version: 7.1Git-2017-03-02 (Git)
Block user comment: N
Private report: N
New Comment:
I have found a reason of my troubles.
IN SQL was another condition:
...
AND upr.user_id = :USER_ID
...
I was binding not variable, but method result. ($User->getUserId()).
There is notice that I shouldn't do that.
This is the reason why next bind of date variable gives such error.
I think it shouldnt looks like this, its veery confusing.
Previous Comments:
------------------------------------------------------------------------
[2017-03-02 09:26:23] wgizynski at gmail dot com
Description:
------------
I think there is a problem with binding variables with condition to Date columns in oracle sql.
It gives ORA-01722 invalid number. With numbers and varchars everything is ok.
Putting directly in sql without binding gives a result.
PHP Version 7.1.1
Oracle Run-time Client Library Version 12.1.0.2.0
Test script:
---------------
...
TO_DATE(:ON_DATE,'YYYY-MM-DD') BETWEEN x.fromdate AND x.todate
...
$onDate = '2017-03-02';
oci_bind_by_name($stid, ":ON_DATE", $onDate)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74195&edit=1