{"record":{"id":"21ec3600c88eca25","repo":"pentaho/pentaho-kettle","slug":"tableoutputmeta-exception-tablenotspecified","errorCode":"TableOutputMeta.Exception.TableNotSpecified","errorMessage":"TableOutputMeta.Exception.TableNotSpecified","messagePattern":"TableOutputMeta\\.Exception\\.TableNotSpecified","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tableoutput/TableOutputMeta.java","lineNumber":920,"sourceCode":"\n  public RowMetaInterface getRequiredFields( VariableSpace space ) throws KettleException {\n    String realTableName = space.environmentSubstitute( tableName );\n    String realSchemaName = space.environmentSubstitute( schemaName );\n\n    if ( databaseMeta != null ) {\n      Database db = new Database( loggingObject, databaseMeta );\n      try {\n        db.connect();\n\n        if ( !Utils.isEmpty( realTableName ) ) {\n          // Check if this table exists...\n          if ( db.checkTableExists( realSchemaName, realTableName ) ) {\n            return db.getTableFieldsMeta( realSchemaName, realTableName );\n          } else {\n            throw new KettleException( BaseMessages.getString( PKG, \"TableOutputMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"TableOutputMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException(\n          BaseMessages.getString( PKG, \"TableOutputMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString( PKG, \"TableOutputMeta.Exception.ConnectionNotDefined\" ) );\n    }\n\n  }\n\n  public DatabaseMeta[] getUsedDatabaseConnections() {\n    if ( databaseMeta != null ) {\n      return new DatabaseMeta[] { databaseMeta };\n    } else {\n      return super.getUsedDatabaseConnections();","sourceCodeStart":902,"sourceCodeEnd":938,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tableoutput/TableOutputMeta.java#L902-L938","documentation":"Thrown when the Table Output step's target table name resolves to empty/null after variable substitution. The step requires a concrete table name to look up field metadata; without one it cannot proceed, so it raises this keyed KettleException instead of the TableNotFound error.","triggerScenarios":"The code path where Utils.isEmpty(realTableName) is true — tableName (or the variable expression) resolves to an empty string when getTableFields()/getFields is invoked.","commonSituations":"Table name field left blank; a ${TABLE_NAME} variable is not defined in the runtime environment so it resolves to empty; using 'Insert table name defined in a field' but the table name field is not set when metadata lookup runs.","solutions":["Enter a table name in the Table Output dialog's Target table field.","If using a variable, define it in the transformation/run configuration (kettle.properties, parameter, or setVariable) so it resolves to a non-empty value.","Validate resolution at runtime with ${...} in a log/preview to confirm the value is non-empty.","If the table name comes from a field, ensure the field is populated for the lookup path used."],"exampleFix":"// before\nString tableName = \"${TARGET_TABLE}\"; // TARGET_TABLE undefined -> resolves to \"\"\n// after (define in kettle.properties or as run parameter)\nTARGET_TABLE=customers","handlingStrategy":"validation","validationCode":"// resolve and check table name before use\nString real = meta.getTableName(); // substitute via VariableSpace in real code\nString resolved = space.environmentSubstitute(real);\nif (resolved == null || resolved.trim().isEmpty()) {\n  throw new IllegalArgumentException(\"Table Output: target table name is empty\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always fill the Target table field or define the variable used","Declare parameters in transformation settings with default values","Validate run configurations (kettle.properties, parameters) before execution"],"tags":["kettle","table-output","configuration","missing-value"],"backgroundTag":"empty-required-field","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"}