PHP script calling in an Oracle environment
10:31 02 Feb 2026

I have the following PHP script that I have inherited, I am getting the following error but I cannot find the issue.

 $headerLineCount && strlen(trim($referenceNo)) > 0){
            $isFirstRow = false;
            $recordNo += 1;
            
            $sqlInsertBody .= "
  ifsapp.client_sys.clear_attr(attr_);
  ifsapp.client_sys.add_to_attr('CF\$_SEQUENCE_NO', ".$sequenceNo.", attr_);
  ifsapp.client_sys.add_to_attr('CF\$_ROW_NO', ".($rowNo-$headerLineCount).", attr_);
  ifsapp.client_sys.add_to_attr('CF\$_ROW_STATE', 'New', attr_);
  ifsapp.client_sys.add_to_attr('CF\$_DATE_CREATED', sysdate, attr_);
  ifsapp.client_sys.add_to_attr('CF\$_ROW_MESSAGE', '', attr_);
  ifsapp.client_sys.add_to_attr('CF\$_REFERENCE_NO', '".$referenceNo."', attr_);
  ifsapp.upload_sowa_wo_reported_clp.New__(info_, objid_, objversion_, attr_, 'DO');

            ";
            
            if($recordNo == $rowsPerBlock){//End of each Block
              $stmtInsert = oci_parse($c, $sqlInsertHead.$sqlInsertBody." end;");
              $resultInsert = oci_execute($stmtInsert);
              if(!$resultInsert){
                $errorInsert = oci_error($stmtInsert);
                echo var_dump($errorInsert).PHP_EOL;
              }else{
                $sqlInsertBody = '';
              }
              $recordNo = 0;
            }////End of each Block
          }//Skip Header line
        }//WHILE each line in the csv file
        
        //Do for the last rows in the last block
        $stmtInsert = oci_parse($c, $sqlInsertHead.$sqlInsertBody." end;");
        $resultInsert = oci_execute($stmtInsert);
        if(!$resultInsert){
          $errorInsert = oci_error($stmtInsert);
          echo var_dump($errorInsert).PHP_EOL;
        }else{
          //echo 'Rows Inserted'.PHP_EOL;
        }

        //Delete or rename the file after processing -- CAN'T DO THIS because the file is comming in from an http URL
      }else{
       $err = oci_error();   
       echo 'Oracle Connect Error ' . $err['text']; 
      }
      fclose($fileHandle);
      
      //Now that all the rows are in, expecute the procedure to process them
      $sqlExecute = "
begin
  ifsapp.cd_file_upload_api.process_sowa_wo_reported(".$sequenceNo.");
end;
      ";
      $stmtExecute = oci_parse($c, $sqlExecute);
      $resultExecute = oci_execute($stmtExecute);
        if(!$resultExecute){
          $errorExecute = oci_error($resultExecute);
          echo var_dump($errorExecute).PHP_EOL;
        }else{
          echo 'Rows Processes'.PHP_EOL;
        }
    }//if file found
  }else{
    echo 'Do not call CLI files from the browser.';
  }

The job is failing see below, 1 thing that I have noticed is that the next sequence number is blank.

Found file, connecting to database... Next Sequence No: array(4) {
["code"]=> int(6550) ["message"]=> string(489) "ORA-06550: line 10, column 2: PLS-00103: Encountered the symbol "/" when expecting one of the following:

( begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge json_exists json_value json_query json_object json_array"
["offset"]=> int(171) ["sqltext"]=> string(1313) " declare
info_ varchar2(2000); objid_ varchar2(200); objversion_ varchar2(200); attr_ varchar2(2000); begin

ifsapp.client_sys.clear_attr(attr_); // ifsapp.client_sys.add_to_attr('CF$SEQUENCE_NO', , attr);
ifsapp.client_sys.add_to_attr('CF$SEQUENCE_NO', 45, attr);
ifsapp.client_sys.add_to_attr('CF$ROW_NO', 1, attr);
ifsapp.client_sys.add_to_attr('CF$ROW_STATE', 'New', attr);
ifsapp.client_sys.add_to_attr('CF$DATE_CREATED', sysdate, attr);
ifsapp.client_sys.add_to_attr('CF$ROW_MESSAGE', '', attr);
ifsapp.client_sys.add_to_attr('CF$REFERENCE_NO', '14373164', attr); ifsapp.upload_sowa_wo_reported_clp.New__(info_, objid_, objversion_, attr_, 'DO');

ifsapp.client_sys.clear_attr(attr_); // ifsapp.client_sys.add_to_attr('CF$SEQUENCE_NO', , attr);
ifsapp.client_sys.add_to_attr('CF$SEQUENCE_NO', 45, attr);
ifsapp.client_sys.add_to_attr('CF$ROW_NO', 2, attr);
ifsapp.client_sys.add_to_attr('CF$ROW_STATE', 'New', attr);
ifsapp.client_sys.add_to_attr('CF$DATE_CREATED', sysdate, attr);
ifsapp.client_sys.add_to_attr('CF$ROW_MESSAGE', '', attr);
ifsapp.client_sys.add_to_attr('CF$REFERENCE_NO', '14343401', attr); ifsapp.upload_sowa_wo_reported_clp.New__(info_, objid_, objversion_, attr_, 'DO');

         end;" }

Fatal error: Uncaught TypeError: oci_error(): Argument #1 ($connection_or_statement) must be of type resource or null, bool given in C:\inetpub\wwwroot\Sandpit\workOrderReportInCli.php:101 Stack trace: #0 C:\inetpub\wwwroot\Sandpit\workOrderReportInCli.php(101): oci_error(false) #1 {main} thrown in C:\inetpub\wwwroot\Sandpit\workOrderReportInCli.php on line 101

php oracle-sqldeveloper