{"record":{"id":"4be5cd1c25df4a2e","repo":"pentaho/pentaho-kettle","slug":"dbproc-exception-couldnotfindfield","errorCode":"DBProc.Exception.CouldnotFindField","errorMessage":"DBProc.Exception.CouldnotFindField","messagePattern":"DBProc\\.Exception\\.CouldnotFindField","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/dbproc/DBProc.java","lineNumber":68,"sourceCode":"  }\n\n  private Object[] runProc( RowMetaInterface rowMeta, Object[] rowData ) throws KettleException {\n    if ( first ) {\n      first = false;\n\n      // get the RowMeta for the output\n      //\n      data.outputMeta = data.inputRowMeta.clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputMeta, getStepname(), null, null, this, repository,\n        metaStore );\n\n      data.argnrs = new int[meta.getArgument().length];\n      for ( int i = 0; i < meta.getArgument().length; i++ ) {\n        if ( !meta.getArgumentDirection()[i].equalsIgnoreCase( \"OUT\" ) ) { // IN or INOUT\n          data.argnrs[i] = rowMeta.indexOfValue( meta.getArgument()[i] );\n          if ( data.argnrs[i] < 0 ) {\n            logError( BaseMessages.getString( PKG, \"DBProc.Log.ErrorFindingField\" ) + meta.getArgument()[i] + \"]\" );\n            throw new KettleStepException( BaseMessages.getString( PKG, \"DBProc.Exception.CouldnotFindField\", meta\n              .getArgument()[i] ) );\n          }\n        } else {\n          data.argnrs[i] = -1;\n        }\n      }\n\n      data.db.setProcLookup( environmentSubstitute( meta.getProcedure() ), meta.getArgument(), meta\n        .getArgumentDirection(), meta.getArgumentType(), meta.getResultName(), meta.getResultType() );\n    }\n\n    Object[] outputRowData = RowDataUtil.resizeArray( rowData, data.outputMeta.size() );\n    int outputIndex = rowMeta.size();\n\n    data.db.setProcValues( rowMeta, rowData, data.argnrs, meta.getArgumentDirection(), !Utils.isEmpty( meta\n      .getResultName() ) );\n\n    RowMetaAndData add =","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/dbproc/DBProc.java#L50-L86","documentation":"DBProc looks up each IN/INOUT stored-procedure argument in the incoming row. When an argument field is not found in the input row (indexOfValue returns -1), the step logs the lookup error and throws this KettleStepException, stopping the step because the procedure cannot be invoked without the parameter.","triggerScenarios":"processRow -> outputRowData -> runProc executes while meta.getArgument()[i] names a field absent from the input row (for IN or INOUT direction).","commonSituations":"Upstream step renamed or removed the field; argument name typo in the DB Procedure step; wrong stream selected when the transform has multiple inputs; case-sensitive field mismatch.","solutions":["Fix the argument name in the DB Procedure step to exactly match a field in the input stream.","Add or restore the field upstream (e.g. via a Select Values / Get Variables step) before this step.","Check the upstream step's field list (right-click -> Show input fields) and correct case-sensitive differences.","If the argument is genuinely optional, change its direction handling or wire a default value into the stream."],"exampleFix":"// before: argument 'custId' but stream has 'customer_id'\nArgument: custId\n// after\nArgument: customer_id","handlingStrategy":"validation","validationCode":"// before running the transform, check arguments exist in the input layout\nfor (int i=0;i<meta.getArgument().length;i++) {\n  if (!\"OUT\".equalsIgnoreCase(meta.getArgumentDirection()[i])\n      && rowMeta.indexOfValue(meta.getArgument()[i]) < 0)\n    throw new IllegalArgumentException(\"Missing DBProc argument field: \"+meta.getArgument()[i]);\n}","typeGuard":"boolean hasField(RowMetaInterface row, String name){ return row.indexOfValue(name) >= 0; }","tryCatchPattern":"try { putRow(rowMeta, outputRowData); }\ncatch (KettleStepException e) {\n  logError(\"DBProc argument missing: \" + e.getMessage(), e);\n  setErrors(1); stopAll(true);\n}","preventionTips":["Verify argument names against the upstream step's output field list.","Watch for case-sensitive field name mismatches.","Fix the field before the step if upstream renames occur.","Use one clear input stream for the DBProc step."],"tags":["kettle","stored-procedure","missing-field"],"backgroundTag":"missing-required-argument","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"}