Informix Error -4048: Driver statements for a report are not allowed within the body of that report.
Cause and resolution
Driver statements for a report are not allowed within the body of that report.
This statement defines a record variable and uses initialization expressions when it declares one or more members. This action is not supported. You can use an initialization expression only when you define a simple variable.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
The live oninit.com page's title/description text for -4048 is mismatched (a known site data quirk, not an addendum error): the title reads about report driver statements, but the actual description text says: a record variable declares initialization expressions on one or more of its members, which isn't supported — initialization expressions are only valid when defining a simple variable.
- A record variable declaration using initialization expressions on its members, per the official description text — the direct, only cause.
Solutions / Resolution
- Remove the initialization expressions from the record's member declarations, and instead assign values in separate statements, per the official description text's identification of simple variables as the only place initializers are supported.
Examples
Initializing a record's members inline
DEFINE rec RECORD
qty INTEGER = 0,
price DECIMAL = 0.00
END RECORD
-- initialization expressions on record members are not supported
Corrected
DEFINE rec RECORD
qty INTEGER,
price DECIMAL
END RECORD
LET rec.qty = 0
LET rec.price = 0.00
Diagnostic Checks
- Check every
RECORDdeclaration for inline initialization expressions on its members, and move any found into separate assignment statements.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4048 in this set yet.
A record variable's members were declared with initialization expressions — only simple variables support inline initializers; assign record members separately.