php.net |  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
34 + 2 = ?
Subscribe to this entry?

 
 [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();
  //OCIInternalDebug(1);
  $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);
        ocifreecursor($lcur);
        echo $res2[0];
      }
      echo "<BR>\n";
    }
    ocifreecursor($rcur);
    ocilogoff($local);
    ocilogoff($remote);
  }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-18 06:32 UTC] thies@php.net
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: Fri Mar 29 11:01:29 2024 UTC