sqlwhere-clausevariable-assignmentmaximo

IBM Maximo (Oracle SQL) Where Clause, defining a variable for reuse


I write many Maximo Where Clauses (which use Oracle SQL), and save them as public queries. I encourage others to edit/customize the work I share with them.

But when my query uses the same string throughout it many times, it's tedious to make sure all instances are replaced. It's not like there's a built-in find-replace tool or anything.

Is there a way to define a custom string variable at the beginning, and reuse that variable many times thoughout the where clause?


Solution

  • No, you can't do that. But what you could do is make a relationship from your parent object to a system property / maxpropvalue child object where propname = 'company.app.varname. Then, you can use the System Properties app to change the value of the variable for all references. And you can make a reference to it in your query using standard :relationshiptomaxpropvalue.propvalue syntax.

    HTH.