I have a PHP script that runs from my webserver. The script is being run as a
CGI script. This script connects to the database using OCI, retrieves 3
records from a one column table, and then disconnects.

db1.us and db2.us are hosted on the same Solaris box. Both dbs have the same
$ORACLE_HOME. I created the same user and same table on both databases.

When the script connects to db1.us, no problem, it retrieves the data and
displays it like I want. When the script runs against db2.us, it connects to
the database and gets a "ORA-03120: two-task conversion routine: integer
overflow" error.

Obviously, something is different between the two dbs, but I don't have a clue of what to look for.

PHP Code:
<html>
<p>Oracle DB Test</p>
<?php

   Putenv
("ORACLE_HOME=/usr/local/oracle");

   
$db=OCILogon("jeffh","jeffh""db1.us");
   if ( 
$db == false ) {
      
$err OCIError();
      
$err_code $err['code'];
      
$err_message $err['message'];
      echo 
$err_code;
      echo 
$err_message;

  echo <<<ERROR_MESSAGE
  <table border="1" cellpadding="0" cellspacing="0" bordercolor="red">
    <tr>
      <th colspan="2">The Following Error Has Occured!</th>
    </tr>
    <tr>
      <th>Code</th>
      <th>Message</th>
    </tr>
    <tr>
      <td>
$err_code</td>
      <td>
$err_message</td>
    </tr>
  </table>
ERROR_MESSAGE;

      exit;
   }

   
$sql="select x from xyz";
   
$cur OCIParse($db$sql);
   if (
OCIError() != false ) {
      
$err OCIError();
   
      
$err_code $err['code'];
      
$err_message $err['message'];

      echo <<<ERROR_MESSAGE
         <table border="1" cellpadding="0" cellspacing="0" bordercolor="red">
           <tr>
              <th colspan="2">The Following Error Has Occured!</th>
           </tr>
           <tr>
              <th>Code</th>
              <th>Message</th>
           </tr>
           <tr>
              <td>
$err_code</td>
              <td>
$err_message</td>
           </tr>
        </table>
ERROR_MESSAGE;
   exit;
   }


   
$res OCIExecute($cur);
   if (
$res == false ) {
      echo 
"error executing...";
      
$err OCIError($cur);
   
      
$err_code $err['code'];
      
$err_message $err['message'];

      echo <<<ERROR_MESSAGE
         <table border="1" cellpadding="0" cellspacing="0" bordercolor="red">
           <tr>
              <th colspan="2">The Following Error Has Occured!</th>
           </tr>
           <tr>
              <th>Code</th>
              <th>Message</th>
           </tr>
           <tr>
              <td>
$err_code</td>
              <td>
$err_message</td>
           </tr>
        </table>
ERROR_MESSAGE;

      exit;
   }

   echo 
"<table border=1>";
   echo 
"<tr><td><b>name</b></td></tr>";
   
   while (
OCIFetchInto($cur$values)) {

      echo 
"<tr><td><b>$values[0]</b></td></tr>";
   }

   echo 
"</table>";

   
OCILogoff($db);

?>
</html>