{"record":{"id":"ea8ca46c47e61fe0","repo":"t8y2/dbx","slug":"missing-firebird-field-type-for-parameter-name","errorCode":null,"errorMessage":"Missing Firebird field type for parameter {name}","messagePattern":"Missing Firebird field type for parameter (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"agents/drivers/firebird/src/main/java/com/dbx/agent/firebird/FirebirdAgent.java","lineNumber":191,"sourceCode":"    private static String parameterDeclaration(ProcedureParameter parameter) {\n        StringBuilder declaration = new StringBuilder(quoteIdentifier(parameter.name()))\n            .append(' ')\n            .append(parameterType(parameter));\n        if (Integer.valueOf(1).equals(parameter.notNull())) {\n            declaration.append(\" NOT NULL\");\n        }\n        if (parameter.defaultSource() != null) {\n            declaration.append(' ').append(parameter.defaultSource());\n        }\n        return declaration.toString();\n    }\n\n    private static String parameterType(ProcedureParameter parameter) {\n        if (parameter.fieldSource() != null && !parameter.fieldSource().startsWith(\"RDB$\")) {\n            return quoteIdentifier(parameter.fieldSource());\n        }\n        if (parameter.fieldType() == null) {\n            throw new IllegalStateException(\"Missing Firebird field type for parameter \" + parameter.name());\n        }\n        int fieldType = parameter.fieldType();\n        int subType = valueOrZero(parameter.fieldSubType());\n        return switch (fieldType) {\n            case 7 -> numericType(\"SMALLINT\", subType, parameter);\n            case 8 -> numericType(\"INTEGER\", subType, parameter);\n            case 10 -> \"FLOAT\";\n            case 11, 27 -> \"DOUBLE PRECISION\";\n            case 12 -> \"DATE\";\n            case 13 -> \"TIME\";\n            case 14 -> characterType(\"CHAR\", \"BINARY\", subType, parameter);\n            case 16 -> numericType(\"BIGINT\", subType, parameter);\n            case 23 -> \"BOOLEAN\";\n            case 24 -> \"DECFLOAT(16)\";\n            case 25 -> \"DECFLOAT(34)\";\n            case 26 -> numericType(\"INT128\", subType, parameter);\n            case 28 -> \"TIME WITH TIME ZONE\";\n            case 29 -> \"TIMESTAMP WITH TIME ZONE\";","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/firebird/src/main/java/com/dbx/agent/firebird/FirebirdAgent.java#L173-L209","documentation":"FirebirdAgent.parameterType renders a procedure parameter's SQL type. If the parameter has no RDB$ field source and fieldType is null, the driver cannot determine a Firebird type and throws IllegalStateException naming the parameter. This indicates incomplete metadata for the procedure parameter record.","triggerScenarios":"Resolving a procedure parameter whose fieldType is null while its fieldSource is absent or starts with 'RDB$' (so the field-source branch is skipped).","commonSituations":"Corrupted or hand-edited RDB$PROCEDURE_PARAMETERS rows; parameters defined against system-named (RDB$) fields with no resolved type; incomplete snapshot of system catalog metadata.","solutions":["Fix the procedure definition in the database so the parameter has a concrete type","Ensure metadata extraction populates fieldType for every parameter","Handle the exception by skipping or flagging parameters with unknown types"],"exampleFix":"// before\nString sqlType = parameterType(parameter); // fieldType == null\n// after\nif (parameter.fieldType() == null && (parameter.fieldSource() == null || parameter.fieldSource().startsWith(\"RDB$\"))) {\n    throw new IllegalStateException(\"Parameter \" + parameter.name() + \" has no resolvable Firebird type; fix the procedure definition\");\n}\nString sqlType = parameterType(parameter);","handlingStrategy":"try-catch","validationCode":"if (p.fieldType() == null && (p.fieldSource() == null || p.fieldSource().startsWith(\"RDB$\"))) { skip(p); }","typeGuard":"static boolean hasResolvableType(ProcedureParameter p) { return p.fieldType() != null || (p.fieldSource() != null && !p.fieldSource().startsWith(\"RDB$\")); }","tryCatchPattern":"try { ddl = agent.getProcedureDdl(name); } catch (IllegalStateException e) { log.error(\"Parameter metadata incomplete: {}\", e.getMessage()); }","preventionTips":["Keep RDB$PROCEDURE_PARAMETERS metadata intact; avoid manual catalog edits","Validate extracted metadata populates fieldType for all parameters","Skip and report parameters with unknown types instead of failing the whole DDL"],"tags":["firebird","missing-metadata","state","procedures"],"backgroundTag":"missing-metadata-field","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}