php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49509 ann't send a date type into oracle parameter
Submitted: 2009-09-09 07:53 UTC Modified: 2009-09-09 08:43 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: hymanyung at 163 dot com Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 5.2.10 OS: Centos 5.3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hymanyung at 163 dot com
New email:
PHP Version: OS:

 

 [2009-09-09 07:53 UTC] hymanyung at 163 dot com
Description:
------------
I want to pass a date type variable into oracle's procedure.
But It automate converts date type into string.

Reproduce code:
---------------
$sql = 'declare ws_time date := :mydate; begin  select con_id from home.zcontp00; end;
$stmt = oci_parse($this->conn, $sql);
$my_cursor = ociNewCursor($this->conn);
$now = date('Y-m-d',strtotime('2009-09-08'));
OCIBindByName($stmt, ":mydate",$now);
OCIBindByName($stmt, ":c1", $my_cursor, -1, OCI_B_CURSOR);	   
OCIExecute($stmt);
OCIExecute($my_cursor);
while ($val = oci_fetch_assoc($my_cursor)){
  echo $val['CON_ID'];
}

Expected result:
----------------
Above Report error.
  " literal does not match format string "


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-09 07:56 UTC] hymanyung at 163 dot com
Pls tell me how to define a date type variable in php and pass date type variable into oracle date type parameter.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 23:01:28 2024 UTC