I have written a function in DB2 - that is calculating ASCII of records in a particular column. I want to some help as I want to check the ASCII of every single character in string return yes if the ASCII of that record is greater than 127.
BEGIN
ATOMIC DECLARE POS,
INT;
IF INSTR IS NULL THEN RETURN NULL;
END IF;
SET
(
POS,
LEN
)=(
1,
LENGTH(INSTR)
);
WHILE POS <= LEN DO IF ASCII( SUBSTR( INSTR, POS, 1 ))> 128 THEN RETURN 'Y';
END IF;
SET
POS = POS + 1;
END WHILE;
RETURN 'N';