utl_raw.cast_to_varchar increase length of String












0















select length(initcap(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')))) 
from dual


length - 6



select length('Chloé') 
from dual


length - 5



I am using this function to change the accented character to base character.










share|improve this question

























  • Thanks Praphul. What is your question? Are you wondering why the length differs between these functions? If so, nlssort is responsible. Some additional information would be helpful, such as your NLS globalization params (NLS_LANGUAGE,NLS_CHARACTERSET, etc.). It would be helpful to DUMP these two items (instead of length). At a glance, it could be that the second example has length of 5 with the literal character string ending in ASCII character 233, vs nlssort's extra null character (0) added to 5-length string ending in character 101. But the extra data would be helpful.

    – alexgibbs
    Nov 21 '18 at 1:29













  • Why do you want to change the accent character?

    – Wernfried Domscheit
    Nov 21 '18 at 5:43











  • length(initcap(...)) is fairly pointless.

    – Wernfried Domscheit
    Nov 21 '18 at 7:50











  • When I try dump(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')), 1016) then I get Typ=1 Len=6 CharacterSet=AL32UTF8: 63,68,6c,6f,65,0, i.e. NLSSORT appends character (0).

    – Wernfried Domscheit
    Nov 21 '18 at 8:16











  • The requirement is to remove all accented characters to base character and as it is name I have added initcap . Once I introduce this utl_raw function , there is a special character being generated at the end of field :- "^@" in UNIX which breaks the down stream process while consuming file . I have tried convert and translate , both are not working on some accented characters , is there a way to remove that NULL character from end , I tried TRIM , doesnt seem to work.

    – Praphul Viswan
    Nov 21 '18 at 14:08
















0















select length(initcap(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')))) 
from dual


length - 6



select length('Chloé') 
from dual


length - 5



I am using this function to change the accented character to base character.










share|improve this question

























  • Thanks Praphul. What is your question? Are you wondering why the length differs between these functions? If so, nlssort is responsible. Some additional information would be helpful, such as your NLS globalization params (NLS_LANGUAGE,NLS_CHARACTERSET, etc.). It would be helpful to DUMP these two items (instead of length). At a glance, it could be that the second example has length of 5 with the literal character string ending in ASCII character 233, vs nlssort's extra null character (0) added to 5-length string ending in character 101. But the extra data would be helpful.

    – alexgibbs
    Nov 21 '18 at 1:29













  • Why do you want to change the accent character?

    – Wernfried Domscheit
    Nov 21 '18 at 5:43











  • length(initcap(...)) is fairly pointless.

    – Wernfried Domscheit
    Nov 21 '18 at 7:50











  • When I try dump(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')), 1016) then I get Typ=1 Len=6 CharacterSet=AL32UTF8: 63,68,6c,6f,65,0, i.e. NLSSORT appends character (0).

    – Wernfried Domscheit
    Nov 21 '18 at 8:16











  • The requirement is to remove all accented characters to base character and as it is name I have added initcap . Once I introduce this utl_raw function , there is a special character being generated at the end of field :- "^@" in UNIX which breaks the down stream process while consuming file . I have tried convert and translate , both are not working on some accented characters , is there a way to remove that NULL character from end , I tried TRIM , doesnt seem to work.

    – Praphul Viswan
    Nov 21 '18 at 14:08














0












0








0








select length(initcap(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')))) 
from dual


length - 6



select length('Chloé') 
from dual


length - 5



I am using this function to change the accented character to base character.










share|improve this question
















select length(initcap(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')))) 
from dual


length - 6



select length('Chloé') 
from dual


length - 5



I am using this function to change the accented character to base character.







oracle non-ascii-characters






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 7:50









Wernfried Domscheit

24k42858




24k42858










asked Nov 20 '18 at 21:53









Praphul ViswanPraphul Viswan

63




63













  • Thanks Praphul. What is your question? Are you wondering why the length differs between these functions? If so, nlssort is responsible. Some additional information would be helpful, such as your NLS globalization params (NLS_LANGUAGE,NLS_CHARACTERSET, etc.). It would be helpful to DUMP these two items (instead of length). At a glance, it could be that the second example has length of 5 with the literal character string ending in ASCII character 233, vs nlssort's extra null character (0) added to 5-length string ending in character 101. But the extra data would be helpful.

    – alexgibbs
    Nov 21 '18 at 1:29













  • Why do you want to change the accent character?

    – Wernfried Domscheit
    Nov 21 '18 at 5:43











  • length(initcap(...)) is fairly pointless.

    – Wernfried Domscheit
    Nov 21 '18 at 7:50











  • When I try dump(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')), 1016) then I get Typ=1 Len=6 CharacterSet=AL32UTF8: 63,68,6c,6f,65,0, i.e. NLSSORT appends character (0).

    – Wernfried Domscheit
    Nov 21 '18 at 8:16











  • The requirement is to remove all accented characters to base character and as it is name I have added initcap . Once I introduce this utl_raw function , there is a special character being generated at the end of field :- "^@" in UNIX which breaks the down stream process while consuming file . I have tried convert and translate , both are not working on some accented characters , is there a way to remove that NULL character from end , I tried TRIM , doesnt seem to work.

    – Praphul Viswan
    Nov 21 '18 at 14:08



















  • Thanks Praphul. What is your question? Are you wondering why the length differs between these functions? If so, nlssort is responsible. Some additional information would be helpful, such as your NLS globalization params (NLS_LANGUAGE,NLS_CHARACTERSET, etc.). It would be helpful to DUMP these two items (instead of length). At a glance, it could be that the second example has length of 5 with the literal character string ending in ASCII character 233, vs nlssort's extra null character (0) added to 5-length string ending in character 101. But the extra data would be helpful.

    – alexgibbs
    Nov 21 '18 at 1:29













  • Why do you want to change the accent character?

    – Wernfried Domscheit
    Nov 21 '18 at 5:43











  • length(initcap(...)) is fairly pointless.

    – Wernfried Domscheit
    Nov 21 '18 at 7:50











  • When I try dump(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')), 1016) then I get Typ=1 Len=6 CharacterSet=AL32UTF8: 63,68,6c,6f,65,0, i.e. NLSSORT appends character (0).

    – Wernfried Domscheit
    Nov 21 '18 at 8:16











  • The requirement is to remove all accented characters to base character and as it is name I have added initcap . Once I introduce this utl_raw function , there is a special character being generated at the end of field :- "^@" in UNIX which breaks the down stream process while consuming file . I have tried convert and translate , both are not working on some accented characters , is there a way to remove that NULL character from end , I tried TRIM , doesnt seem to work.

    – Praphul Viswan
    Nov 21 '18 at 14:08

















Thanks Praphul. What is your question? Are you wondering why the length differs between these functions? If so, nlssort is responsible. Some additional information would be helpful, such as your NLS globalization params (NLS_LANGUAGE,NLS_CHARACTERSET, etc.). It would be helpful to DUMP these two items (instead of length). At a glance, it could be that the second example has length of 5 with the literal character string ending in ASCII character 233, vs nlssort's extra null character (0) added to 5-length string ending in character 101. But the extra data would be helpful.

– alexgibbs
Nov 21 '18 at 1:29







Thanks Praphul. What is your question? Are you wondering why the length differs between these functions? If so, nlssort is responsible. Some additional information would be helpful, such as your NLS globalization params (NLS_LANGUAGE,NLS_CHARACTERSET, etc.). It would be helpful to DUMP these two items (instead of length). At a glance, it could be that the second example has length of 5 with the literal character string ending in ASCII character 233, vs nlssort's extra null character (0) added to 5-length string ending in character 101. But the extra data would be helpful.

– alexgibbs
Nov 21 '18 at 1:29















Why do you want to change the accent character?

– Wernfried Domscheit
Nov 21 '18 at 5:43





Why do you want to change the accent character?

– Wernfried Domscheit
Nov 21 '18 at 5:43













length(initcap(...)) is fairly pointless.

– Wernfried Domscheit
Nov 21 '18 at 7:50





length(initcap(...)) is fairly pointless.

– Wernfried Domscheit
Nov 21 '18 at 7:50













When I try dump(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')), 1016) then I get Typ=1 Len=6 CharacterSet=AL32UTF8: 63,68,6c,6f,65,0, i.e. NLSSORT appends character (0).

– Wernfried Domscheit
Nov 21 '18 at 8:16





When I try dump(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')), 1016) then I get Typ=1 Len=6 CharacterSet=AL32UTF8: 63,68,6c,6f,65,0, i.e. NLSSORT appends character (0).

– Wernfried Domscheit
Nov 21 '18 at 8:16













The requirement is to remove all accented characters to base character and as it is name I have added initcap . Once I introduce this utl_raw function , there is a special character being generated at the end of field :- "^@" in UNIX which breaks the down stream process while consuming file . I have tried convert and translate , both are not working on some accented characters , is there a way to remove that NULL character from end , I tried TRIM , doesnt seem to work.

– Praphul Viswan
Nov 21 '18 at 14:08





The requirement is to remove all accented characters to base character and as it is name I have added initcap . Once I introduce this utl_raw function , there is a special character being generated at the end of field :- "^@" in UNIX which breaks the down stream process while consuming file . I have tried convert and translate , both are not working on some accented characters , is there a way to remove that NULL character from end , I tried TRIM , doesnt seem to work.

– Praphul Viswan
Nov 21 '18 at 14:08












1 Answer
1






active

oldest

votes


















0














Solved the issue :



SELECT INITCAP(REPLACE(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')),CHR(0),''))FROM dual






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402152%2futl-raw-cast-to-varchar-increase-length-of-string%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Solved the issue :



    SELECT INITCAP(REPLACE(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')),CHR(0),''))FROM dual






    share|improve this answer




























      0














      Solved the issue :



      SELECT INITCAP(REPLACE(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')),CHR(0),''))FROM dual






      share|improve this answer


























        0












        0








        0







        Solved the issue :



        SELECT INITCAP(REPLACE(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')),CHR(0),''))FROM dual






        share|improve this answer













        Solved the issue :



        SELECT INITCAP(REPLACE(utl_raw.cast_to_varchar2(nlssort('Chloé','nls_sort=binary_ai')),CHR(0),''))FROM dual







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 '18 at 17:18









        Praphul ViswanPraphul Viswan

        63




        63






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402152%2futl-raw-cast-to-varchar-increase-length-of-string%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            RAC Tourist Trophy