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

Similar Messages

  • Hfm opening function how it works?

    Opening function :"If the View parameter is YTD, the opening value is retrieved from the last period of the prior,  l If the View parameter is Periodic, the opening value is retrieved from the prior period of the prior year."
    I found the following table in Admin guide, I didn't understand the account part in this table.
    Account
    Dec-11
    Jan-12
    Feb-12
    Mar-12
    A#FA_COST
    900
    1,200
    1,100
    1,500
    Opening(“A#FA_COST”, “ ”)
    N/A
    900
    900
    900
    Opening(“A#FA_COST”, “ YTD”)
    N/A
    900
    900
    900
    Opening(“A#FA_COST”, “Periodic ”)
    N/A
    900
    1200
    1100
    I want to use this fuction for MY cashflow reporting .but it is not working . it is showing only YTD values . i used expence type for my cashflow accounting members. please give me advise.
    sagi

    Hi Techies,
    I want to brief my question. actually my client requirement is In HFM for particular accounts in cash flow they required caliculation If the View parameter is YTD, the opening value is retrieved from the last period of the prior,  l If the View parameter is Periodic, the opening value is retrieved from the prior period of the prior year." how can i achieve this requirement?

  • User Defined External Function - How to work?

    I have defined some external functions in java by following the description in
    C:\OraBPELPM_3\integration\orabpel\samples\demos\XSLMapper\ExtensionFunctions
    I can use my functions in JDeveloper, but they do not work on the Oracle BPEL engine.
    Is it enough just to place the jar-file in <OC4J_HOME>\j2ee\home\applib and add the jar-file in class-path (as described)?
    What about the xml-file specifying the functions (called SampleExtentionFunctions.xml in the documentation)?
    Should this file be copied to <OC4J_HOME>\... ?
    Here is the error message I get by running my service:
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "ora:processXSLT("TransformationInput.xsl", bpws:getVariableData("inputVariable", "request"))", the reason is java.lang.NoSuchMethodException: For extension function, could not find method org.apache.xpath.objects.XNodeSet.leadingZeros([ExpressionContext,] #NUMBER)..
    Please verify the xpath query.
    ______________ MY JAVA CODE EXAMPLE: _____________________________
    package extentionfunctions;
    This is a sample XSL Mapper User Defined Extension Functions implementation class.
    public class JavaExtensionFunctionsBpel
    * Inserts leading zeros to a text, if this starts with a digit.
    * Else the return value will be the same as the given text.
    * The return value will have the specified length.
    public static String leadingZeros(String text, int len)
    {  String retur = text;
    char c = (text == ""?'0':text.charAt(0));
    if ('0'<=c && c<='0'+9) { // Is first char a digit?
    retur = "";
    int n = len - (text == ""?0:text.length());
    for (int i=0; i<n; i++) { // Insert zeros:
    retur = '0' + retur;
    retur = retur + text;
    return retur;
    * Removes leading zeros from a text.
    public static String removeLeadingZeros(String text)
    {  String retur = text;
    int pos = 0;
    int len = (text == ""?0:text.length());
    for (int i=0; i<len; i++) {
    if (text.charAt(i)=='0') { // Is char a digit?
    pos++;
    return retur;
    public static void main(String[] args)
    { // Basic test of functions:
    int len = 5;
    String s = "1234";
    String r;
    System.out.println("leadingZeros("+s+","+len+")="+(r=leadingZeros(s,len)));
    System.out.println("removeLeadingZeros("+r+")="+removeLeadingZeros(s));
    Regards
    Flemming Als

    Flemming, it looks like somthing is wrong in the xsl that it still goes to org.apache.xpath.objects.XNodeSet package instead of yours ..
    I created a sample that illustrates the usage of this functions (even with 2 params, different types).
    Java class (com.otn.samples.xslt.CustomXSLTFunctions)
    package com.otn.samples.xslt;
    public class CustomXSLTFunctions
    <function name="extension:multiplyStringAndInt" as="number">
    <param name="base" as="String"/>
    <param name="multiplier" as="number"/>
    </function>
    public int multiplyStringAndInt (String pString, int pMultiplier)
    int base = Integer.parseInt(pString);
    return base * pMultiplier;
    XML descriptor:
    Note the types (in the java class and the xml descriptor)
    for java:base -> string and for xslt:base -> string
    for java:multiplier -> int and for xslt:multiplier -> number
    <?xml version="1.0" encoding="UTF-8"?>
    <extension-functions>
    <functions extension:multiplyStringAndInt="http://www.oracle.com/XSL/Transform/java/com.otn.samples.xslt.CustomXSLTFunctions">
    <function name="extension:multiplyStringAndInt" as="number">
    <param name="base" as="string"/>
    <param name="multiplier" as="number"/>
    </function>
    </functions>
    </extension-functions>
    Definition of variables in the process:
    (as you can see, the base is a string - I do the conversion in my method, and the return value
    is converted to a string by the engine)
    <!-- Input -->
    <element name="CustomXSLTFunctionProcessRequest">
    <complexType>
    <sequence>
    <element name="base" type="string"/>
    <element name="multiplier" type="int"/>
    </sequence>
    </complexType>
    </element>
    <!-- Output -->
    <element name="CustomXSLTFunctionProcessResponse">
    <complexType>
    <sequence>
    <element name="result" type="string"/>
    </sequence>
    </complexType>
    </element>
    Using the new function in the XSL transformation:
    - watch out for the namespace declaration (xmlns:sample="...")
    - and the usage (sample:multiplyStringAndInt)
    <xsl:stylesheet version="1.0"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:extension="http://www.oracle.com/XSL/Transform/java/com.otn.samples.xslt.CustomXSLTFunctions"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:ns0="http://www.w3.org/2001/XMLSchema"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:client="http://xmlns.oracle.com/CustomXSLTFunction"
    exclude-result-prefixes="xsl plnk ns0 client ldap xp20 bpws extension ora orcl">
    <xsl:template match="/">
    <client:CustomXSLTFunctionProcessResponse>
    <client:result>
    <xsl:value-of select="extension:multiplyStringAndInt(/client:CustomXSLTFunctionProcessRequest/client:base,/client:CustomXSLTFunctionProcessRequest/client:multiplier)"/>
    </client:result>
    </client:CustomXSLTFunctionProcessResponse>
    </xsl:template>
    </xsl:stylesheet>
    Then I created a jar file with the class (and for testing the xml descriptor in it)...
    and put it into j2ee/home/applib directory
    hth clemens

  • 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

  • How to open and close files from UIwindow my function doesn't work

    Hello guys!
    I am trying to create a simple ui-interface.
    I made one button so far.
    but my function does not work.
    if I run the function without dialog box it works perfectly!
    when I running the function in the dialog window, picking a file and open, nothing happens why?
    please help me with a correct code.
    also how do I write  2 functions that also closing a file and  saving a file?
    here is my simple code.
    var w = new Window ("dialog");
    button.onClick = function () {
    OpenMyFile();
    w.show ();
    function OpenMyFile(){
    var myFile = File.openDialog();
    app.open(myFile)
    Thank you in advance.

    Well, to answer your first question, you've added an event listener, but you haven't actually added the button itself.
    try this:
    var w = new Window ("dialog");
    b = w.add("button", undefined, "Click me!");
    b.onClick = function () {
    OpenMyFile();
    w.show ();
    function OpenMyFile(){
    var myFile = File.openDialog();
    app.open(myFile)

  • How to delete multiple songs from iPhone 5S without losing form iTunes? The unchek function has not worked. Why?

    How to delete multiple songs from iPhone 5S without losing form iTunes? The unchek function has not worked. Why?

    Sorry I had to reply through your profile Gail from Maine, my PC has java issues. In any event, when I delete them directly from my device everything is perfect and cool. However, in the rare instance I want to add new music that I actually buy in stores (I know, quite the unique and old-fashioned idea...but hey Im an audiophile) once I upload the tunes, everytime I sync my library it re-adds everything that I spent hours deleting. In a perfect world, I thought I could maintain a massive iTunes Library, and add or delete (remove) songs from my iPhone to save both memory or keep my iPhone selections more current/apt to my musical "tastes" at that time. I know about the whole playlist thing, but thought there might be an easier way. ie - checking/un-checking the little box next to the song name, and then doing a sync. Again, everytime I do this however, whether everything is checked or un-checked it adds the entire library! So frustrating. Any suggestions. Thank you graiously in advance for your help.

  • 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

  • The autorotation function has stopped working in my text message app. only.  It is working for all other applications.  What has happened? How can I fix it.  The autorotate is on.

    The autorotation function has stopped working in my text message appnly.  It is working in all other apps.  The autorotation is turned on!  What has happened?  How do I correct this?

    1. Try quitting the Messaging app
    Double tap the Home button, hold the app icon until it wiggles, tap the red dot, tap the Home button twice
    Relaunch
    2. Reset: Hold the Sleep/Wake and Home buttons until the screen goes dark and the Apple logo appears

  • Foreign Currency Translation at Year End - How SAP Works for P&L items?

    Hi All,
    I wanted to know "How SAP works on Foreign Currency Translation at year end" from Local Currency to Group Currency for P&L Items.
    I know how SAP works for Balance sheet items but am really confused with when the translation was done for P&L Items.
    Configuration:
    We are on ECC 6.0 . Local Currency is CAD and we have 2nd Local Currency as "USD - Group Curr".
    We have set up Valuation Method - 4
    We have set up Valuation Area - 40
    For Account Determination for Currency Translation, GL accounts (Loss, Gain and B/S Adj)  were setup for the combination of Chart of Accounts, Val Area and Fin Stmt Ver.
    Sales Account Balance
    CAD (LC)        USD (2nd LC)       
    1000                   920                        
    Using tcode "FAGL_FC_TRANS", we translated our P&L items.
    Local Currency is CAD and Group Currency is USD.
    CAD 1000 and USD 920 are cumulative balances over a period of time.
    Since at the end of year CAD became stronger, exchange rate is 1.11 as an example
    Sales Account Balance
    CAD (LC)        USD (2nd LC)        Translated Value in USD
    1000                   920                        900
    System passed the following entry in USD:
    Debit Balance Sheet Adj A/c 20
    Credit Translation Gain / Loss A/c 20
    Here are the questions:
    1. How does over all translation work? - Should we get any Gain / Loss and have an effect on P&L when all accounts (P&L, B/S) are translated?
    2. How can there be a gain entry when USD value has really fallen from 920 to 900 in the current case.
    Thanks for your time.
    Vijay

    Hi,
    I had this issue too.  The entry was just opposite to what it should be.  I just flipped the accounts in table FAGL_T030TR.
    Example: 410000 is sales account which normally should have a credit balance.  Here are some entries that were posted to sales in 03/2009 and I am running FAGL_FC_TRANS at the end of the month.
    March 1, 2009 Cr. Sales CAD 1000- USD 900-
    March 2, 2009 Cr. Sales CAD  500- USD 480-
    During FC translation transaction, system takes the balance in the account for the period (if you execute it with 'Val. period balance only' checkbox checked) and not the cumulative balance.  SAP recommends translating period balance only (and not cumulative balance) for P&L accounts.  It sees a balance in LC (this again depends on the config. you have in OB22 - whether the indicator is 1 (TC as source currency) or 2 (LC as source currency for translation)) which is 1500, converts that at month end rate.  After conversion, lets say the balance is 1400-.
    In this case, we expect a credit entry on sales account
    March 31, 2009 Cr. Sales CAD 0  USD 20-
    But system was just posting the opposite.  I then flipped the accounts in FC translation configuration.  I know it is misleading.  In that configuration, system says balance sheet adjustment account, but what you should actually give there is your gain/loss account.  Our gain/loss a/c. falls in the same GL account range as the main account.  For example, for 410000, it is 410999 and for 510000, it is 510999.  We report accounts 410000 to 410999 in the same node in the FSV.
    Pl. feel free to ask further questions about this.  Pl. test in your system and correct me if my above reply is wrong.
    Cheers!

  • How can I sum up raws? the sum function seems to work for columns only and right now I have to create a separate formula for each raw

    How can I sum up raws? the Sum function seems to work only on columns. Right now I have to create a separate formula for each raw

    Hi dah,
    "Thanks, but can I do one formula for all present and future raws? as raws are being added, I have to do the sum function again and again"
    You do need a separate formula for each group of values to be summed.
    If the values are in columns, you need a copy of the formula for each column.
    If the values are in rows, you need a copy of the formula for for each row.
    If you set up your formulas as SGIII did in his example (shown below), where every non-header row has the same formula, Numbers will automtically add the formula to new rows as you add them.
    "Same formula" in this context means exactly the same as all the formulas above, with one exception: the row reference in each formula is incremented (by Numbers) to match the row containing the formula.
    Here the formula looks like this in the three rows shown.
    B2: =SUM(2)
    B3: =SUM(3)
    B4: =SUM(4)
    That pattern will continue as rows are added to the table.
    Also, because the row token (2) references all of the non-header cells in row 2, the formula will automatically include new columns as they are added to the table.
    Regards,
    Barry

  • My search function does not work. How can I fix it?

    Hello
    I need help I just bough a macbook 13 inch, with snow leopard
    and the search function does not work.
    The window opens but when I write the name i searh it gives me no results.
    How can i fix it?
    Do i need really to re install all snow leopard?
    thanks
    pt

    Hello paola t & welcome to the forums
    I need help I just bough a macbook 13 inch
    It may be that Spotlight hasn't completed indexing just yet - is there a dot (indicates busy) inside the magnifying icon top right?
    Also, check System Preferences/Spotlight to see what if any exclusions are configured, etc.

  • How do I stop a tool from functioning on my work after I finish using it?

    How do I stop a tool from functioning on my work after I finish using it?

    Switch to another tool?
    I really don't know what you mean by "stop functioning". The Zoom tool will always work when selected.
    Is there a specific example you have in mind?  Give us the exact version of Photoshop you are using, and the version of Mac OSX or Windows.
    A screenshot outlining your problem is best.
    Gene

  • Function to calculate how many working date there are.

    Good morning,
    there is a Function/Object to calculate how many working days there are between two dates?
    thanks
    M

    If you have problems finding in the forum the answer to this question, please re-post it and mention how you searched and how the results didn't help.
    Thread locked.
    Rob

  • I purchased an additional audio function for the apps "baby monitor"today, but this function didn't work on my ipad. Grateful if you would let me know how to refund the cost.

    I purchased an additional audio function for the apps "baby monitor"today, but this function didn't work on my ipad. Grateful if you would let me know how to refund the cost.

    Refund
    http://www.apple.com/emea/support/itunes/contact.html

  • 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?

Maybe you are looking for

  • Item category "N" and "L"

    Hi , In procurements related to projects i saw some document Item categary "N" for non stock material and item category "L" for stock material .  But in standard SAP item category "N" is not their in both purchase order and purchase requisition docum

  • Is mozjs.dll spyware as Malwarebytes says it is?

    Malwarebytes reports that mozjs.dll is (Spyware.OnlineGames). When I have Malwarebytes remove it, Firefox 4 will not run. What's up with this? Should I revert back to Firefox3.6.16? Thank you

  • Declaring constructor method public or private.  What's the point?

    My book declares the constructor method public. I tried declaring it private, and without any modifier out of curiousity. It runs exactly the same. What's the point of doing so? public class test      public static void main( String[] args )         

  • Migrating forms 2000 to forms 6i

    Hi, does anyone of you tried to migrate forms 2000 to 6i. everytime I try that, I am getting an error - "ifbld60.exe has generated errors and will be closed by Windows. You will need to restart the program." (rigt after I open the file and connect to

  • Is it possible to use an iPhone that is bought in USA in Europa?

    USA iPhone in Europa??