0

This is my problem:

DECLARE
    my_clob NCLOB;
BEGIN
    FOR rec IN (
        SELECT CLOB_TEXT
        FROM MY_TABLE a
           WHERE CL_LANGUAGE = 'ru')
    LOOP
        my_clob := rec.CLOB_TEXT;
        DBMS_OUTPUT.PUT_LINE(my_clob);
    END LOOP;
END;

I try to put the data from the column CLOB_TEXT (NCLOB) into the variable my_clob(NCLOB).

That's fine... but the problem comes when the text from CLOB_TEXT is in cyrillic.

When I print my_clob, it is shown with ¿ in every character. Any solution?

The charset from database:

NLS_NCHAR_CHARACTERSET(AL16UTF16)
NLS_CHARACTERSET(WE8ISO8859P1)

MrGreen
  • 61
  • 1
  • 2
  • 4
  • What is the data type of CLOB_TEXT? and if it's not NCLOB what is your NLS_CHARACTERSET? If it is NCLOB what is your environments NLS_LANG? – Ben Jan 13 '17 at 09:00
  • Thanks for answer. CLOB_TEXT data type is NCLOB and NLS_LANGUAGE in database is AMERICAN – MrGreen Jan 13 '17 at 09:02
  • Can you check if the value of `NLS_NCHAR_CHARACTERSET` is UTF8. If not set it to UTF8 and try once – XING Jan 13 '17 at 09:17
  • The NLS_NCHAR_CHARACTERSET is AL16UTF16. I cannot change the charset from database because i don't have permission. But I think UTF16 is unicode to. Makes any difference use UTF8 or UTF16? Thanks for your help – MrGreen Jan 13 '17 at 09:45
  • @XING, that is not possible - at least not with a single command. Character set migration is a bigger task see [Character Set Migration](https://docs.oracle.com/database/121/NLSPG/ch11charsetmig.htm#NLSPG011). Also you should prefer `AL32UTF8` rather than `UTF8`. – Wernfried Domscheit Jan 13 '17 at 10:31
  • 1
    Where do you run this PL/SQL Block? SQL*Plus, TOAD, SQL Developer? What is the `NLS_LANG` value at your machine? – Wernfried Domscheit Jan 13 '17 at 10:33

0 Answers0