|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8546 OCIFetchInto ORA-01001 when same db and different user
Submitted: 2001-01-04 06:38 UTC Modified: 2001-02-18 06:32 UTC
From: oboehm at appligos dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.0.4 OS: Win98
Private report: No CVE-ID: None
 [2001-01-04 06:38 UTC] oboehm at appligos dot com
The html produced by the code below :

Result : TAB1,12:11:47

Warning: OCIFetchInto: ORA-01001: invalid cursor in C:\www\php\test.php3 on line 11


I got this error only when i call ocilogon with the same db param (same net8 alias).

No error when :
- the db param is different (different net8 alias),
- same oracle database but different net8 alias name.

So, replace "db" by "db2" in the second call to ocilogon and declare a new net8 alias named db2 to the same oracle database and you got no error.


  $res = array();
  $local = ocilogon("user1", "pass1", "db");
  $remote = ocilogon("user2","pass2", "db");
  if($local && $remote) {
    $select1 = "select table_name from user_tables";
    $select2 = "select to_char(sysdate, 'HH24:MI:SS') from dual";
    $rcur = ociparse($remote, $select1);
    ociexecute($rcur, OCI_DEFAULT);
    while(ocifetchinto($rcur, &$res, OCI_ASSOC+OCI_NUM+OCI_RETURN_NULLS)) {
      echo "Result : " .$res[0] . ",";
      $lcur = ociparse($local, $select2);
      if($lcur) {
        ociexecute($lcur, OCI_DEFAULT);
        ocifetchinto($lcur, &$res2);
        echo $res2[0];
      echo "<BR>\n";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-18 06:32 UTC]
if user/pw/dbname are the same the oci driver reuses the 
*same* connections and you only get one transaction 
context. to isolate the sessions please use ocinlogon for 
either $local or $remote (or both;-)

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 07:01:28 2024 UTC