Skip to content
A3J Group
← All articles Development

“Null SQL String Passed” in Maximo BIRT Reports: The Error Is Lying to You

By

You’ve checked every join, counted every parenthesis, and the query runs perfectly in DBeaver. So why does your report keep failing? Because the SQL was never the problem.

If you’ve built or modified Maximo BIRT reports long enough, you’ve seen this one:

[jcc]… Null SQL string passed. ERRORCODE=-4461

The natural reaction is to go hunting through your SQL for a syntax error. You check the joins, count the parentheses, and paste the query into DBeaver, where it runs perfectly.

That’s because in almost every case, the query never got built at all. The DB2 driver is telling the truth, since it really was handed a null string, but it’s reporting the symptom, not the cause.

Why This Happens

Most custom Maximo reports use scripted datasets. If you’ve opened a report in the BIRT designer, the pattern will look familiar:

The work is split across two methods. open() builds the SQL string and hands it to the provider with setQuery(). fetch() executes it and reads the rows.

Here’s the catch: if something throws an exception in open() before setQuery() runs, the report doesn’t necessarily stop there. Execution can carry on into fetch(), which tries to run a query that was never set. DB2 receives nothing and responds with “Null SQL string passed.”

So the error surfaces at fetch(), but the bug lives earlier, in open().

The Usual Suspects

In practice, the exception that kills your query build is usually one of these:

  • Restricted Java classes. Calls like Packages.java.text.SimpleDateFormat can work fine in the BIRT designer but fail inside Maximo’s script sandbox, where Java class loading is restricted in some contexts.
  • Unexpected parameter formats. Maximo can pass dates as ISO strings, m/d/yyyy, Java Date objects, or nothing at all. Date-parsing code that assumes one format throws on the others.
  • JavaScript methods called on Java objects. Calling toLocaleDateString() on a Java Date is the classic example.
  • Null handling. Calling .toString() or .replace() on a parameter that arrived empty.
  • A missing setQuery() call. Sometimes nothing throws at all. The call was deleted or never added during an edit, and the result is the same error.

The common thread: your report works in the designer, works with the parameters you tested, and then breaks the first time a user runs it from Report Administration or a list view with a different set of inputs.

Step 1: Read the Real Log

The Maximo UI shows you the DB2 wrapper error. The application server log shows you the actual exception.

On Maximo 7.6 (WebSphere): open SystemOut.log for the JVM that served the report request (the UI cluster member, or your report cluster if you run one separately).

On MAS: check the logs of the Manage pods serving the UI. From the OpenShift CLI:

# Find the Manage UI pods for your instance
oc get pods -n mas-<instanceId>-manage | grep -i ui

# Pull the log and look at what happened just before the DB2 error
oc logs <pod-name> -n mas-<instanceId>-manage –all-containers | grep -B 30 “Null SQL string”

If your environment forwards logs to Splunk, ELK, or OpenShift Logging, search there instead around the timestamp of your report run.

Either way, you’ll typically find the real JavaScript or Java exception, often with a line number, sitting just before the DB2 error. Most of the time, this one step turns a mystery into a five-minute fix.

Step 2: Make open() Fail Loudly

Once you know the pattern, the better fix is to write datasets that can’t fail silently. Wrap the query-building logic in a try/catch and make sure setQuery() never receives null:

Now, instead of a misleading DB2 error, the log names the dataset and the actual cause. If your report has several scripted datasets, you know immediately which one broke.

Notice the pattern in buildDateFilter(): when an optional parameter is missing, it returns a harmless predicate like ” and 1=1″. An empty optional parameter then simply means “don’t filter” rather than crashing the report. Give every optional filter its own helper and its own try/catch, and one bad input can’t take the whole query down with it.

Pro Tip: Push date handling into SQL whenever you can. Passing a normalized string to DB2’s timestamp() or date() functions sidesteps the restricted SimpleDateFormat problem and the Java-vs-JavaScript Date confusion in one move. Adjust the substring logic to match the format your report parameters actually arrive in, and test with an empty value, not just a valid one.

Step 3: Isolate When the Log Isn’t Enough

If you can’t get to the server logs (common on locked-down MAS environments or customer-hosted systems), work by elimination:

  1. Replace the dynamic SQL with a hard-coded query you know is valid, for example select wonum, description, status from workorder fetch first 10 rows only. If the report runs, the plumbing is fine and the problem is in your query-building code.
  2. Reintroduce the dynamic pieces one at a time: the where parameter, then the date filter, then the site filter, then any parameter lookups.
  3. Re-import and run after each change until it breaks again. The last piece you added is your culprit.

It’s tedious, but it always works.

A Bonus Trap: && in Your Scripts

While you’re in there, watch out for &&. Scripts live inside CDATA blocks in the .rptdesign XML, and && can get re-escaped when a report goes through Maximo’s import/export cycle. That can corrupt otherwise working code, and it may even be the exception that caused your null query in the first place.

The fix is simple: avoid && in report scripts entirely. Use nested if statements or small helper functions instead:

The Takeaway

When you see “Null SQL string passed,” stop debugging your SQL. Ask instead: what threw before setQuery() ran? Check the server log, then harden open() so the next failure tells you exactly what went wrong.

The error message isn’t really lying. It’s just answering a different question than the one you’re asking.

Still staring at a null query?
Sometimes the fastest fix is a second set of eyes. The A3J Group team builds, troubleshoots, and modernizes Maximo BIRT reports every day, on 7.6 and MAS. Send us the error and the log snippet, and we’ll help you track down what threw before setQuery() ran.


👉 [Connect with A3J Group]


About

A3J Group is a leading solutions and consulting firm based in Tampa, Florida, specializing in Enterprise Asset Management (EAM) with a focus on fully developed Computerized Maintenance Management System (CMMS) solutions like IBM Maximo.

In addition to our suite of proprietary products—including MxMobile, our powerful mobile solution for Maximo—we provide traditional consulting services that help organizations plan, implement, optimize, and support their EAM strategies. Whether clients need hands-on configuration, strategic guidance, or ongoing system support, our team delivers the expertise to drive long-term success.

With over 50 years of combined experience, our specialized team is dedicated to our core mission: to serve as excellent stewards of our clients’ trust and investments, while driving measurable results through tailored, high-impact solutions and intelligent consulting.

Visit us at www.a3jgroup.com. Or drop us a line at info@a3jgroup.com.

Related articles

DevelopmentLog4J Security Vulnerability System Patching for WebSphereDevelopmentEditing Font Sizes in IBM Maximo – Long Description and Log DefaultsAutomation ScriptsMBOs in Automation Scripts: Putting It All Together