var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: SUBSTR - need to calc the start position...
I'm writing queries against DB2 v18.104.22.168.
db2level returns 'Instance "DB2" uses "32" bits and DB2 code release "SQL08010" with level identifier "01010106".
I have a 60 character column called "Class".
The values in "Class" are Basic, Advanced, Basic-EXT, Advanced-EXT.
I need to identify only those values that end with "-EXT".
I had thought that I could use SUBSTR but I'm not providing the correct syntax to identify the start position which needs to the the length - 2.
SUBSTR (Class, LENGTH(RTRIM(Class))-2,2)
It does process SUBSTR (Class, LENGTH(RTRIM(Class)),2) but I only get 'T' back.
You are computing the length of the string after any trailing blanks have been removed, but you are not removing them from the base string. Try something like: substr(rtrim(class),length(rtrim(class))-2,2)
If you only need to identify them why not use LIKE '%-EXT'
Done and DONE
Thanks to both of you for your advice. The LIKE '%-EXT%' got me what I needed.