Maximo Open Forum

 Querying for specific text in longdescription

  • End User
Silva testes2's profile image
Silva testes2 posted 08-19-2025 03:49

Hello.

I need some help from the gurus, if possible. I've read some other threads about querying longdescription but I have failed to get what I need (I always get an SQL error).

I want to search for specific text within the longdescription field, using the WHERE clause in the advanced search of the workorder.

The result should be a list of workorders where I can then build a report to export the fields I need to review.

Can someone help, please? Thanks in advance.

Using Maximo 7.6.4.

Beat Keller's profile image
Beat Keller

For SQL Server try this:

exists (select 1 from longdescription 
where workorder.workorderid = ldkey 
and ldownertable = 'WORKORDER' 
and ldtext like '%XXXX%')
and historyflag = 0 
and istask = 0 
and siteid = 'YYYY'

Replace XXXX with the text you search and YYYY with the siteid.

Please note that searching for longdescriptions is not very fast and should not be used frequently (not in start centers).

Brad Delong's profile image
Brad Delong

Don't include the word where, but try this:

Where WorkOrderID in

(Select LDKey From Maximo.LongDescription Where LDOwnerTable = 'WORKORDER' and lower(LDText) like '%[whatever you are searching for here in lowercase]%')

and replace [whatever you are searching for here in lowercase] with what you are looking to find.

Stevie Holloway's profile image
Stevie Holloway

Hi,

This works with a SQL Server backend.

EXISTS (
    SELECT 1
    FROM longdescription ld
    WHERE ld.ldownertable = 'WORKORDER'
      AND ld.ldownercol   = 'DESCRIPTION'  
      AND ld.ldkey        = workorder.workorderid
      AND ld.ldtext LIKE '%XXXX%'
)

NOTE: XXXX is your specific search criteria