Translate function help

Please some one explain why it is showing output of below query
select translate('XXXX','X','ABCD') FROM DUAL;
AAAA

Hi,
ibney wrote:
Please some one explain why it is showing output of below query
select translate('XXXX','X','ABCD') FROM DUAL;
AAAA
TRANSLATE (arg1, arg2, arg3)     returns a string that is a copy of arg1, except that every character found in arg2 is changed to the corresponding character in arg3.
In this example, 'X' is the 1st character in arg2, so every 'X' is changed to the 1st character in arg3, that is, 'A'.
If you don't understand how TRANSLATE works, it would be more helpful for you to start with an example where arg2 and arg3 have more than 1 distinct characters.  The SQL language manual has an example like that (see Manik's message); Ramin posted another example above.
If you don't understand how the description in the SQL manual applies to a particular problem, say exactly what you don't understand.  For example "I expected TRANSLATE ('XXXX', 'X', 'ABCD') to return ...because ... but it returns 'AAAA'.  That seems to contradict the manual, which says ... "

Similar Messages

  • HOW TO USE TRANSLATE FUNCTION

    Hi
    in XSQL i am one getting one row like this
    <REASON_FOR_REJECTION>1.Overhead line is not existing in front of the premises,2.The distance from the pole to the serice is more than 30 meters.,3.Another service is existing in the same premises with arrears.</REASON_FOR_REJECTION>
    In the above String for every comma i want to put <br>
    the output should come like this:
    1.Overhead line is not existing in front of the premises
    2.The distance from the pole to the serice is more than 30 meters.
    3.Another service is existing in the same premises with arrears
    i have used translate function like this <xsl:value-of select="translate($REASON_FOR_REJECTION,',',&lt;br>)'"/>
    but i couldnt get proper result;how can i do this ??? PLZZ HELP

    Hi Jayant,
    please have a look at the following link: http://help.sap.com/saphelp_nw04s/helpdata/en/ae/48e7428d877276e10000000a1550b0/frameset.htm
    Regards,
    Christophe

  • Translate function

    hi,
         How to use Translate function in VC? Please tell me with one exmple.
          Points will be given to correct solution.
    Cheers,
    Jayant

    Hi Jayant,
    please have a look at the following link: http://help.sap.com/saphelp_nw04s/helpdata/en/ae/48e7428d877276e10000000a1550b0/frameset.htm
    Regards,
    Christophe

  • I had a translate function in my tool bar when I updated firefox it went awa

    had a translate function in the toolbar, when I updated firefox it went away and I cannot figure out how to get it back. Basically ifyou were on a e mail or website that was in a different language you just hit this and it translated it no highlighting no cut and paste HELP I am an american living in a foreign country and am desperate

    That was probably from the "Google Toolbar".
    :see https://support.mozilla.com/questions/837473
    You can avoid the overhead, care and feeding of extensions and other problems of extensions with a '''bookmarklet''' which has a '''keyword''' to invoke it directly from the Location Bar.
    '''Name:''' tr: translate from (fr, de, etc.)
    :'''Location:''' javascript:location='http://translate.google.com/translate?u='+encodeURIComponent(location);
    :'''Keyword:''' tr:
    :'''Description:''' Test page http://web.de/ and http://web.nl/

  • Office 2010 build-in translate function not work

    Hi there,
    The Office 2010 translate function is not work on user's desktop, word/outlook/excel, none of them working. It was working before. at that time, I can simply select a word, right click and then select translate, from the right side pane, I can select from
    English to Chinese, and then give me the detail translation information of the word. But suddenly, this function was not working anymore and we did not change anything on MS Office. When I did the same steps, it shows no results were found.
    When I check the translation options, it shows English to Chinese is selected under available language pairs. The weird thing is, when I change the translation setting to from Dutch to Chinese, it translated to Chinese with the very simple result. so any idea
    to get it fixed?
    Regards,
    David

    Hi David,
    Please first make sure your Office 2010 is fully patched. In addition, we can try to run a repair of your Office installtion to check the result:
    http://office.microsoft.com/en-us/powerpoint-help/repair-office-programs-HA010357402.aspx
    Thanks,
    Steve Fan
    TechNet Community Support

  • Using translate function to correct character set problem....

    I have a table(TBL_STOCK) on Oracle XE.
    Rows come from sql server 2005 with a trigger on sql server table via the linked server.
    But there is a character set problem with some character like İ,Ş,Ğ.
    They change to Ý,Þ,Ð. in Oracle.
    How can i correct these ? Do you suggest the TRANSLATE function ?
    What do u think, if i create an After Insert trigger on Oracle table(TBL_STOCK) and convert these character using the Translate function when they inserted from sql server.
    Anyone have any other ideas that can be more efficient. Any thoughts appreciated.
    Thanks in advance.
    Adam
    PS:The NLS_CHARACTERSET of Oracle is AL32UTF8.

    It is sql server 2005 and Collation is SQL_Latin1_General_CP1_CI_AS

  • Using Translate() function of XSLT ...

    Hi guys
    I have an xml document that i am converting into an html document using XSLT. I need to replace the XML new lines(&#10) with html new lines (<br>) while the xslt transform takes place on my xml document.
    For this I have found the translate function of XSLT but I need to use it on a specific tag and not all the tags in the xml document.
    <ExampleTag>
    1 first line
    2 second line
    3 third line
    </ExampleTag>
    translate(string, replaced_text, replacement_text)
    so I need to get my tags value in the variable string which is:
    1 first line
    2 second line
    3 third line
    and replaced_text: '&#10' and replacement_text: '<br>'
    but the problem is XSLT syntax is so bad that i just cant devote enough time to learn it. Any suggestions for the syntax guys?? an example would be extremely useful.
    cheers :)

    Hey
    after a bit of struggle came up with this:
    <xsl:template match="ExampleTag">
    <xsl:variable name="string" select="."> </xsl:variable>
    translate(string, "&#10", "</br>" )
    <xsl:value-of select="$string"/>
    </xsl:template>
    but its not working :(
    any suggestions??

  • Problem with translate function (C++ parser v9)?

    When upgrading to v9 of the C++ parser, we notice a problem with the translate function within xsl stylesheets. Take the following snippet :-
    <StartDt><xsl:value-of select="translate(string(CheckInDate),'-','')"/></StartDt>
    Previously, this statement would strip the '-' chars from our input dates of the form 2002-05-02 to give 20020502. It now does not replace the '-' chars which causes our transformed output to be invalid. We have many developed and tested xsl's which now don't work.
    When we revert to v8, the same xsl's work correctly.
    This happens on all platforms (Windows/Linux/Solaris).
    Anyone else noticed this?
    Regards,
    Mike

    It worked for me as well.
    Use DUMP to find out the char code used for é and ú and try to replace these character codes.
    On my system it is 130 and 163
    SELECT TRANSLATE('héllú wúrld', 'éú', 'eu'),
           dump('héllú wúrld'),
           TRANSLATE('héllú wúrld', chr(130)||chr(163), 'eu')
    FROM   dual;
    hellu wurld
    Typ=96 Len=11: 104,130,108,108,163,32,119,163,114,108,100
    hellu wurld

  • Using translate function for one to many character translation

    Hi friends!
    Can anybody tell me whether it is possible to use built in translate function for converting some text from a one alphabet to another one, if these alphabets are of different length. Something like
    SELECT TRANSLATE('текст',
    'АБВГДЕЕЖЗИКЛМНОПРСТУФХЦЧШЩЭЮЯ',
    'ABCGDEF"*GH*"HIJKLMNOPQRSTYVWXYZ') FROM dual;
    Or there is another function for this, or it is impossible?
    Thanks

    Hi,
    Maybe you could use REPLACE just once, and then TRANSLATE the rest?
    Something like:
    SELECT TRANSLATE(REPLACE('ABcDE', 'c', 'xz'),
                     'ABCDE',
                     'abcde')  from dual;
    TRANSLATE(REPLACE('ABCDE','C','XZ'),'ABCDE','ABCDE')
    abxzde                                             
    1 row selected.Regards
    Peter

  • Replace function help

    Hi all, sry for post sql problens in APEX forum, but i realy need help for this...
    I´m trying to replace : for , to make a select where in () with more then one value... but the replace function its not work with more then 1 value...
    like this
    select name from vw_requerente where id_cliente in REPLACE(:P5000_CLIENTE,':',',')in that item has this value: 71:72:73 , but all i get is a ORA: INVALID NUMBER, how can i make a replace function to work with this?
    tnks alot and sry my english.

    He also posted this in the pl/sql forum and received some good advice there:
    replace function help
    Especially the tom kyte blog portion:
    [http://tkyte.blogspot.com/2006/06/varying-in-lists.html]
    Thank you,
    Tony Miller
    Webster, TX

  • Encrypt/Decrypt using REPLACE/TRANSLATE function

    Hi,
    Can someone please provide me any procedure/function which encrypts/decrypts a string using REPLACE/TRANSLATE function?
    Thanks
    Dinakar

    example with TRANSLATE:
    CREATE OR REPLACE function temp_encrypt (p_value IN VARCHAR2)
    RETURN VARCHAR2 IS
    BEGIN
        RETURN(TRANSLATE(p_value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'BCDEFGHIJKLMNOPQRSTUVWXYZA'));
    END;
    CREATE OR REPLACE function temp_decrypt (p_value IN VARCHAR2)
    RETURN VARCHAR2 IS
    BEGIN
        RETURN(TRANSLATE(p_value, 'BCDEFGHIJKLMNOPQRSTUVWXYZA', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'));
    END;
    SQL> SELECT temp_decrypt('MY TEST') FROM dual;
    TEMP_DECRYPT('MYTEST')
    LX SDRS
    SQL> SELECT temp_encrypt('LX SDRS') FROM dual;
    TEMP_ENCRYPT('LXSDRS')
    MY TESTyou may combine this with REPLACE() ...

  • How to translate Function text matching to fucntion code?

    I try to translate Function text matching to Function code in GUI status?
    Is there any way you know how to solve it?

    Do you want to get Function code related to function Text in GUI Status programatically?

  • Translate() function in an xpath predicate

    I'm trying to use the translate() function in an xpath predicate, and it appears to be having no effect. For instance, I have the following XML document (abbreviated for clarity):
    <metadata>
    <baseObject>
    <PublicationTime>2003-06-30T21:45:56Z</PublicationTime>
    </baseObject>
    </metadata>
    The following xpath expression returns no nodes:
    metadata[translate(baseObject/PublicationTime, "-:TZ", "") = "20030630214556"]
    But this next expression does return a node:
    metadata[translate(baseObject/PublicationTime, "-:TZ", "") = "2003-06-30T21:45:56Z"]
    It appears to me that the translate function is not removing the -, :, T, and Z characters as would be expected. Am I misunderstanding the usage of the translate function, making an error in my xpath expression, or is there some other explanation?
    Thanks.
    Brian

    Brian
    This looks like a bug in the implementation of translate
    Filed as bug 3036042

  • Translate function How it Work??

    Hi,
    In Translate function I understood for single character replacement.
    But Multiple and encript i am unable to got it.
    pls guide me.
    SELECT TRANSLATE('comma,delimited,list', ',', '|')
    FROM dual;
    SELECT TRANSLATE('CAG-TTT-GAC-ACA-TGG-ATC', 'ACGT', 'GATC') DNA
    FROM dual;
    SELECT TRANSLATE('So What', 'ah', 'e')
    FROM dual;
    SELECT TRANSLATE('"Darn double quotes "', 'A"', 'A')
    FROM dual;
    SELECT TRANSLATE('this is a secret',
    'abcdefghijklmnopqrstuvxyz', '0123456789qwertyuiop[kjhbv')
    FROM dual;
    Bold script I am unable to understood. pls guide me.
    Regards,
    Venkat.

    -- SELECT TRANSLATE(SUBSTR('venkat',1,4),
    --                  'e0123456789',
    --                  'R') from dual;
    -- In the string -> SUBSTR('venkat',1,4) = 'venk'
    -- Convert all occurrences of "e" to "R"
    -- Convert all occurrences of "0" to ""  i.e. to NULL
    -- Convert all occurrences of "1" to ""  i.e. to NULL
    -- Convert all occurrences of "2" to ""  i.e. to NULL
    -- Convert all occurrences of "3" to ""  i.e. to NULL
    -- Convert all occurrences of "4" to ""  i.e. to NULL
    -- Convert all occurrences of "5" to ""  i.e. to NULL
    -- Convert all occurrences of "6" to ""  i.e. to NULL
    -- Convert all occurrences of "7" to ""  i.e. to NULL
    -- Convert all occurrences of "8" to ""  i.e. to NULL
    -- Convert all occurrences of "9" to ""  i.e. to NULL
    -- Let the other characters remain as they are
    test@ora>
    test@ora> SELECT TRANSLATE(SUBSTR('venkat',1,4),'e0123456789','R') from dual;
    TRAN
    vRnk
    test@ora>
    -- SELECT TRANSLATE(SUBSTR('venkat',1,4),
    --                  'efghijklmno',
    --                  'R') from dual;
    -- In the string -> SUBSTR('venkat',1,4) = 'venk'
    -- Convert all occurrences of "e" to "R"
    -- Convert all occurrences of "f" to ""  i.e. to NULL
    -- Convert all occurrences of "g" to ""  i.e. to NULL
    -- Convert all occurrences of "h" to ""  i.e. to NULL
    -- Convert all occurrences of "i" to ""  i.e. to NULL
    -- Convert all occurrences of "j" to ""  i.e. to NULL
    -- Convert all occurrences of "k" to ""  i.e. to NULL
    -- Convert all occurrences of "l" to ""  i.e. to NULL
    -- Convert all occurrences of "m" to ""  i.e. to NULL
    -- Convert all occurrences of "n" to ""  i.e. to NULL
    -- Convert all occurrences of "o" to ""  i.e. to NULL
    -- Let the other characters remain as they are
    test@ora>
    test@ora> SELECT TRANSLATE(SUBSTR('venkat',1,4),'efghijklmno','R') from dual;
    TR
    vR
    test@ora>HTH
    isotope
    I thought the explanation was clear enough the first time.
    what is the Mistake in my script.There is no mistake in your script.
    There is no mistake in the output spewed by Oracle.
    It is as per documentation.
    Check the documentation to get a better grasp of this concept:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions196.htm#SQLRF06145
    Message was edited by:
    isotope
    Message was edited by:
    isotope

  • I can please answer in English, I have a translator, please help me. thank you very much

    I can please answer in English, I have a translator, please help me. thank you very much

    what i would do is buy a new battery... can you turn you macbook on with the charger pluged in? if so that means that you need to replace the battery. happened to me

Maybe you are looking for