[Progress Communities] [Progress OpenEdge ABL] Forum Post: Weird behaviour with TRIM() LEFT-TRIM() and RIGHT-TRIM() when dealing with multiple charact

  • Thread starter Thread starter slacroixak
  • Start date Start date
Status
Not open for further replies.
S

slacroixak

Guest
Hi Forum , we are a bit surprised to find nothing about this weird behaviour in the KBase as the TRIM() RIGHT-TRIM() and LEFT-TRIM() are rather old 4GL Functions MESSAGE TRIM ( ' AND ARTICLE.fieldA = "abc" AND ARTICLE.fieldB = "123"' , " AND" ) VIEW-AS ALERT-BOX . /* Notice 'ARTICLE' gets truncated to 'RTICLE' --------------------------- Message (Press HELP to view stack trace) --------------------------- RTICLE.fieldA = "abc" AND ARTICLE.fieldB = "123" --------------------------- OK Aide --------------------------- */ The impact is bad for building typical dynamic queries with " AND bladibla " expressions conditionally added to some cqueryString. At a point one needs to change "WHERE AND" into "WHERE ". The TRIM technique is nasty because it only affects tables with name beginning 'A' (or 'O' with OR) We already have a work-around** but I thought others might want to know about this nasty one. **The best is to use the SUBSTRING() Statement to remove a targeted ' AND'

Continue reading...
 
Status
Not open for further replies.
Back
Top