{"record":{"id":"765c38bffc230348","repo":"pentaho/pentaho-kettle","slug":"could-not-find-field-orabulkdataoutput","errorCode":null,"errorMessage":"Could not find field ","messagePattern":"Could not find field ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkDataOutput.java","lineNumber":125,"sourceCode":"\n    Const.repl( buf, enclosure, enclosure + enclosure );\n    return buf.toString();\n  }\n\n  @SuppressWarnings( \"ArrayToString\" )\n  public void writeLine( RowMetaInterface mi, Object[] row ) throws KettleException {\n    if ( first ) {\n      first = false;\n\n      enclosure = meta.getEnclosure();\n\n      // Setup up the fields we need to take for each of the rows\n      // as this speeds up processing.\n      fieldNumbers = new int[meta.getFieldStream().length];\n      for ( int i = 0; i < fieldNumbers.length; i++ ) {\n        fieldNumbers[i] = mi.indexOfValue( meta.getFieldStream()[i] );\n        if ( fieldNumbers[i] < 0 ) {\n          throw new KettleException( \"Could not find field \" + meta.getFieldStream()[i] + \" in stream\" );\n        }\n      }\n\n      sdfDate = new SimpleDateFormat( \"yyyy-MM-dd\" );\n      sdfDateTime = new SimpleDateFormat( \"yyyy-MM-dd HH:mm:ss.SSS\" );\n\n      outbuf = new StringBuilder();\n    }\n    outbuf.setLength( 0 );\n\n    // Write the data to the output\n    ValueMetaInterface v;\n    int number;\n    for ( int i = 0; i < fieldNumbers.length; i++ ) {\n      if ( i != 0 ) {\n        outbuf.append( ',' );\n      }\n      number = fieldNumbers[i];","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/oracle-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/orabulkloader/OraBulkDataOutput.java#L107-L143","documentation":"On the first writeLine call, OraBulkDataOutput resolves each configured stream field's index in the incoming row via mi.indexOfValue. If a configured field is not in the row (index < 0), it throws 'Could not find field <name> in stream'. This is a mismatch between the loader's field list and the actual row layout.","triggerScenarios":"writeLine is called after the field list was lazily initialized and meta.getFieldStream()[i] does not match any value name in the incoming RowMeta — renamed/deleted upstream field or stale step mapping.","commonSituations":"Upstream step renamed a column; Select Values removed a field; field names differ by case or whitespace; transformation edited without refreshing the loader's field table.","solutions":["Open the Oracle Bulk Loader step and refresh the field mapping ('Get fields')","Rename or re-add the missing field upstream so it matches the configured field name","Preview the previous step to confirm exact field names (case/whitespace)"],"exampleFix":"// before\nmeta.setFieldStream( new String[] { \"id\", \"amount_old\" } );\n// after\nmeta.setFieldStream( new String[] { \"id\", \"amount\" } );","handlingStrategy":"validation","validationCode":"for ( String f : meta.getFieldStream() ) {\n  if ( mi.indexOfValue( f ) < 0 ) {\n    throw new KettleException( \"Missing stream field: \" + f );\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  oraOutput.writeLine( rowMeta, row );\n} catch ( KettleException e ) {\n  logError( \"Field mapping stale: \" + e.getMessage() );\n}","preventionTips":["Refresh the loader field list after any upstream change","Preview the previous step to confirm field names exactly","Avoid case/whitespace variations in field names"],"tags":["kettle","oracle","field-mapping","stream"],"backgroundTag":"record-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}