RAWTOHEX is a SQL function, as opposed to a PL/SQL function, and must be used in a SQL statement. SQL has no concept of an assignment opperator, :=.
So change
l_strng := RAWTOHEX........
to
SELECT RAWTOHEX(p_string) INTO l_string FROM dual;
RAWTOHEX 函数确实是SQL函数,我经过了多次测试,得到的结果与你相同,按说rawtohex既然为sql函数,执行 a:=rawtohex( 'aaaa ')时就应该报错,至于oracle为什么不报错,我也说不清楚,也许真的有两个版本。总之你知道就行了。
似乎a:=rawtohex(x)大致相当于select rawtohex(hextoraw(x)) into a