t8y2/dbx · error · IllegalStateException

Missing Firebird field type for parameter {name}

Error message

Missing Firebird field type for parameter {name}

What it means

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.

Source

Thrown at agents/drivers/firebird/src/main/java/com/dbx/agent/firebird/FirebirdAgent.java:191

    private static String parameterDeclaration(ProcedureParameter parameter) {
        StringBuilder declaration = new StringBuilder(quoteIdentifier(parameter.name()))
            .append(' ')
            .append(parameterType(parameter));
        if (Integer.valueOf(1).equals(parameter.notNull())) {
            declaration.append(" NOT NULL");
        }
        if (parameter.defaultSource() != null) {
            declaration.append(' ').append(parameter.defaultSource());
        }
        return declaration.toString();
    }

    private static String parameterType(ProcedureParameter parameter) {
        if (parameter.fieldSource() != null && !parameter.fieldSource().startsWith("RDB$")) {
            return quoteIdentifier(parameter.fieldSource());
        }
        if (parameter.fieldType() == null) {
            throw new IllegalStateException("Missing Firebird field type for parameter " + parameter.name());
        }
        int fieldType = parameter.fieldType();
        int subType = valueOrZero(parameter.fieldSubType());
        return switch (fieldType) {
            case 7 -> numericType("SMALLINT", subType, parameter);
            case 8 -> numericType("INTEGER", subType, parameter);
            case 10 -> "FLOAT";
            case 11, 27 -> "DOUBLE PRECISION";
            case 12 -> "DATE";
            case 13 -> "TIME";
            case 14 -> characterType("CHAR", "BINARY", subType, parameter);
            case 16 -> numericType("BIGINT", subType, parameter);
            case 23 -> "BOOLEAN";
            case 24 -> "DECFLOAT(16)";
            case 25 -> "DECFLOAT(34)";
            case 26 -> numericType("INT128", subType, parameter);
            case 28 -> "TIME WITH TIME ZONE";
            case 29 -> "TIMESTAMP WITH TIME ZONE";

View on GitHub (pinned to c0390bff16)

Solutions

  1. Fix the procedure definition in the database so the parameter has a concrete type
  2. Ensure metadata extraction populates fieldType for every parameter
  3. Handle the exception by skipping or flagging parameters with unknown types

Example fix

// before
String sqlType = parameterType(parameter); // fieldType == null
// after
if (parameter.fieldType() == null && (parameter.fieldSource() == null || parameter.fieldSource().startsWith("RDB$"))) {
    throw new IllegalStateException("Parameter " + parameter.name() + " has no resolvable Firebird type; fix the procedure definition");
}
String sqlType = parameterType(parameter);
Defensive patterns

Strategy: try-catch

Validate before calling

if (p.fieldType() == null && (p.fieldSource() == null || p.fieldSource().startsWith("RDB$"))) { skip(p); }

Type guard

static boolean hasResolvableType(ProcedureParameter p) { return p.fieldType() != null || (p.fieldSource() != null && !p.fieldSource().startsWith("RDB$")); }

Try / catch

try { ddl = agent.getProcedureDdl(name); } catch (IllegalStateException e) { log.error("Parameter metadata incomplete: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Resolving a procedure parameter whose fieldType is null while its fieldSource is absent or starts with 'RDB$' (so the field-source branch is skipped).

Common situations: 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.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/ea8ca46c47e61fe0. Report an issue: GitHub.