Document Type | Troubleshooting
Category | App Development
Applicable Product Version | 6FS07
Error Codes | 15046, 15146
Document Number | TDETS018
Issue
When using the UTL_RAW.CONVERT function, the following example code produces TBR-15146 error.
DECLARE rawvar RAW(100); to_charset VARCHAR(100); from_charset VARCHAR2(100); literal VARCHAR2(100); BEGIN literal := 'A'; to_charset := 'US7ASCII'; from_charset := 'UTF8'; rawvar := utl_raw.convert(UTL_RAW.CAST_TO_RAW(literal), to_charset, from_charset); dbms_output.put_line(rawvar); END; / TBR-15146: PSM compilation error. TBR-15046: Identifier is out of scope. at line 10, column 11 of null: rawvar := utl_raw.convert(UTL_RAW.CAST_TO_RAW(literal), to_charset, from_charset
Cause
The patch implementing the UTL_RAW.CONVERT function does not exist, causing TBR-15146 error.
Solutions
If the UTL_RAW.CONVERT function query cannot be executed, it is necessary to check whether the binary includes patch 232649.
After confirmation, apply the FS07_CS_232649a patch to resolve the issue.
CautionApply the patch through technical support provided by Tmax Tibero.
Note
Since the utl_raw.convert function converts raw type data into raw type data of another charset, the following steps can be applied as a workaround.
Convert the raw type data to be converted into varchar type using utl_raw.cast_to_varchar2. Use the converted varchar type data as an argument for the CONVERT function to change to another charset. Convert the converted varchar type data back to raw type using utl_raw.cast_to_raw function.declare str_utf varchar2(100); str_euc varchar2(100); r_utf raw(100); r_euc raw(100); begin str_utf := convert ('ํ ์คํธstr', 'UTF8', 'EUCKR'); r_utf := utl_raw.cast_to_raw(str_utf); -- r_utf is raw data in UTF8 charset str_utf := utl_raw.cast_to_varchar2(r_utf); str_euc := convert(str_utf, 'EUCKR', 'UTF8'); dbms_output.put_line(str_euc); -- normal output r_euc := utl_raw.cast_to_raw(str_euc); -- r_euc is raw data in EUCKR charset end; /