I am trying to use NORMALIZE_STRING
inside a stored function under DB2,:
CREATE FUNCTION foo(INSTR VARCHAR(4000) CCSID UNICODE)
RETURNS VARCHAR(4000) CCSID UNICODE
READS SQL DATA
APPLICATION ENCODING SCHEME UNICODE
BEGIN
SET RESULT = NORMALIZE_STRING(INSTR, NFD);
RETURN RESULT;
END#
However, I can not pass the second argument to the function, as this results in an error:
VARIABLE NFD IS NOT DEFINED OR NOT USABLE. SQLCODE=-312, SQLSTATE=42618, DRIVER=4.13.111
Is there any way I can get this working?
Do I have to specify some kind of scope/namespace/... to make clear that I am not referring to a local variable named "NFD", but to some constant, instead? The same applies to NFC
, NFKC
and NFKD
.
Or is there any way to pass this parameter using another value (an integer constant maybe)?
I am looking forward to your ideas!