I am fetching one field from DB table which is of length CHAR35 and I want to use the same in another SELECT statement via FOR ALL ENTRIES where field name of 10 character is being compared with field of 35 characters.
I don't want to use offset method but wanted to convert CHAR35 field into CHAR10 field using CAST operator in SELECT statements. I searched couple of threads on SDN but couldn't help.
Can anyone suggest.
You can try using the LEFT function in the SELECT statement to convert the CHAR35 field into a CHAR10 field. This will extract the 10 leftmost characters of the CHAR35 field and return it as a CHAR10 field. Syntax:
SELECT LEFT(<char35_field>, 10)
SELECT LEFT(field_name_35, 10)