Function to get reversal of any string ..!

hi ,
Is there any function in oracle to get reversal of any string.
'london' --> 'nodnol'
select func_name('london') from dual; --> is there any built-in function to do this operation?
result- 'nodnol'
rgds,
pc

SQL> with t as (
  select 'nodnol' str from dual
select str,
       reverse (str) rev1,
       utl_raw.cast_to_varchar2 (utl_raw.reverse (utl_raw.cast_to_raw (str))) rev2,
       xmlquery('codepoints-to-string(reverse(string-to-codepoints(.)))' passing xmlelement(e,str) returning content).getstringval() rev3
  from t
STR    REV1   REV2       REV3     
nodnol london london     london   
1 row selected.Note:
REV1 is undocumented!
REV2 works just for single-byte characters

Similar Messages

  • Is there any function module getting the cpu type?

    Is there any function module getting the cpu type?

    I guess the database server...
    I would like to get the SAP system cpu type as done in transaction st06 under system information.
    Thanks.

  • Is there any function to get baseline date

    Dear all,
    Is there any function to get baseline date according to the payment terms?
    Thank you in advance.

    have a lokk here:
    determine due date
    A.

  • I have the original AIR recently it has really slowed down. Every function usually gets the pinwheel. It is up to date and has 10g of free disk space. Any suggestions as to the cause?

    I have the original AIR recently it has really slowed down. Every function usually gets the pinwheel. It is up to date and has 10g of free disk space. Any suggestions as to the cause?

    Often a failed disk or power supply. See:
    https://encrypted.google.com/search?q=%22time+capsule%22+%22orange+light%22&as_q dr=all&newwindow=1&num=100

  • User defined function for getting last string in the line

    Hi Experts,
    I am not java expert, can anyone give me user defined function for getting last string in the line.
    for example if the source field is "NEW ARBOUR SQUARE"  i want to pass to target field only last string that is "SQUARE"
    please help me out of this.
    Kind Regards.
    Praveen.

    You don't even need a UDF for this. In the graphical editor look for the standard functions and once you do a scroll over on 'text functions; you will find what you are looking for.
    Just a piece of advice, try keeping UDF's to minimum unless really required or it is complicated without it.
    regards

  • Is there any function to get the name of the days?

    Hi,
    I'm using oracle 10.2.0.1.0
    Is there any function to get the days of the week?
    like i need to get sunday,monday,tuesday.....saturday.
    I know i can use union and select the name from dual one by one.
    But just want to know whether there is any other way.
    I need to show the 7 days in a poplist in my form, thats the requirement
    Thanks

    David_Aldridge wrote:
    BluShadow wrote:
    Note: you may want to include "fm" in the format mask, otherwise the name of the day is padded with spaces:
    SQL> ed
    Wrote file afiedt.buf
    1  select replace(to_char(dt,'Day'),' ','*') as fmt1
    2        ,length(to_char(dt,'Day')) as length_fmt1
    3        ,replace(to_char(dt,'fmDay'),' ','*') as fmt2
    4        ,length(to_char(dt,'fmDay')) as length_fmt2
    5  from (select TRUNC(SYSDATE ,'DAY')+Level-1 dt
    6        from   dual
    7        connect by Level<8
    8*      )
    SQL> /
    FMT1      LENGTH_FMT1 FMT2      LENGTH_FMT2
    Monday***           9 Monday              6
    Tuesday**           9 Tuesday             7
    Wednesday           9 Wednesday           9
    Thursday*           9 Thursday            8
    Friday***           9 Friday              6
    Saturday*           9 Saturday            8
    Sunday***           9 Sunday              6
    7 rows selected.
    SQL>
    I think you should use a pl/sql function for this.
    Nah ... just joking.
    I'd be tempted to just use a union all statement to return the seven literals. People will look at it and know exactly what it does.Yeah, agreed, I was just demonstrating that the format mask of a to_char(..., 'Day') pads with spaces, which seems to have been missed in the above answers. ;)

  • Reverse Of any number,Fibonacci sequence

    hi all,
    Can i find the reverse of any number and Fibonacci sequence in a SELECT query
    without using pl/sql and reverse function.
    please reply...

    Hi,
    extreme wrote:
    ... can you give me example for both 10g and 11gR2 recursive sub-queriesRecursive sub-queries were introduced in Oaracle 11.2; there are no recursive sub-queries in earlier versions.
    Here's one way of getting the reverse of a NUMBER in Oracle 10 (and up):
    WITH     got_txt     AS
         SELECT     TO_CHAR (12345, 'TM')     AS txt
         FROM     dual
    ,     exploded_txt     AS
         SELECT     LEVEL               AS pos
         ,     SUBSTR (txt, LEVEL, 1)     AS a_char
         FROM     got_txt
         CONNECT BY     LEVEL <= LENGTH (txt)
    SELECT  TO_NUMBER ( REPLACE ( XMLAGG ( XMLELEMENT ( e
                                              , a_char
                                          ).EXTRACT ('//text()')
                                 ORDER BY  pos     DESC
                )     AS reverse_num
    FROM    exploded_txt
    ;As written, this only does one number per query. It can be adapted to do several numbers at the same time, but it's somewhat messier.
    Starting in 11.2, you cn also use a recursive sub-query, as show below.
    This method can easily handle multiple numebrs in the same query. You'll probably get them from one of your existing tables, not hard-coded in a sub-query, like sample_data, below:
    WITH     sample_data AS
         SELECT  12345     AS n     FROM dual     UNION ALL
         SELECT     30.2             FROM dual     UNION ALL
         SELECT     0          FROM dual
    ,     got_txt (n, step, txt, reverse_txt)     AS
         SELECT     n
         ,     1                    AS step
         ,     TO_CHAR (n, 'TM')          AS txt
         ,     SUBSTR ( TO_CHAR (n, 'TM')
                     , 1
                     , 1
                     )               AS reverse_txt
         FROM    sample_data
        UNION ALL
         SELECT     n
         ,     step + 1          AS step
         ,     txt
         ,     SUBSTR ( txt
                     , step + 1
                     , 1
                     ) || reverse_txt     AS reverse_txt
         FROM    got_txt
         WHERE     step     < LENGTH (txt)
    SELECT     n
    ,     TO_NUMBER (reverse_txt)     AS reverse_n
    FROM     got_txt
    WHERE     step     = LENGTH (txt)
    ;A somewhat simpler problem is how to reverse a given string.
    As you can see, boith of the approaches above start by converting the given number to a string, and end by converting it back to a NUMBER, to meet your requirements.
    Neither version (as posted) handles negative numbers properly. Both can be adapted to do so.

  • Get name of query string parameter in JSTL

    Is there a way to get only the query string name in a URL in JSTL?
    i.e.
    http://www.mysite.com/mypage.jsp?name=value
    and return "name" as a string. I can't seem to find any documentation saying this is possible.

    If I am using c:out or any of the jstl-core tags I don't think the request.getXYZ functions will work in tandem. (Correct me if I'm wrong). It seems like they are called before the request is called (my terminology is awful, sorry). So by the time request.getParameterNames() is called, <c:out value = ""/> has already finished - hence I can't use the value from request.getParameterNames(). I guess I wasn't clear when I asked the question that that is what I wanted to do.
    This isn't exactly what I wanted but it will work:
    <c:forEach var='parameter' items='${paramValues}'>
    <c:out value='${parameter.key}'/>
    </c:forEach>
    at http://www.informit.com/articles/article.asp?p=30946&seqNum=7
    I answered my own question but thanks anyway.

  • Server side function not get called after dispatching cairngorm event second time on same page

    Hi All,
    I am facing a urgent issue regarding cairngorm event. Actually my page contain 3 button add,delete,save
    and  clicking of any button I do the respected functionality. For ex:
    I click the add button & on clicking of add button I fire a cairngorm evnt & after getting response from server side that the record is added
    I displayed a message that the record is added & update the data source.
    After addition of the record , with out going to other page if I perform the same functionaly(Like adding another record) on same page the cairngorm
    event not call the server side function  -  after debugging I find out that cairngorm event  reach to the corresponding excutecommand function & called that function  but it is not calling my server side function & I also din't get any error message .
    I dont know why  the server side function not get called?. similarly if I try for delete or update case the same things happend. Only for the first time it works properly but not for the second  time.
    Could any of  you please tell me why the cairngorm event not calling the server side function.
    Thank you for your kind assistance.
    Regards,
    Ujjwal

    Okay, well I think I've worked out the problem.
    In ASP.NET we would typically bind repeating controls such as DataLists and Repeaters manually using <i>Control</i>.DataBind(), because we're usually using a separate class library containing collections for our objects. Seems the SAP Table control doesn't like this approach.
    I changed the code so that the databinding is specified on the control, and call the Page's DataBind() method and it all worked fine.
    One tip: because the collection I used to bind to is in a separate class library, I receieved a <i>BC306523: Reference required to assembly MyAssemblyName...</i> message, even though I had a reference to the assembly in my project and the DLL is being properly deployed. To fix this, you must include the following directive at the top of the component's ASCX file:
    <%@ Assembly Name="AssemblyName" %>

  • Idoc - Partner Function not getting captured.

    Dear all,
    I am using IDOC (type - /NFM/ORDERS05) to send a Purchase Order. The Idoc is getting created but the only a few partner function is getting captured from the Partners tab in the ME22n transaction. The remaining partner functions that are not captured are SP (Forwarding Agent) and ER (Employee responsible).
    Any bright ideas how to solve this problem.
    Points will be awarded.

    Hi Vivek,
    Thanks for your reply.
    1. Where do i have set the receiver port and the message type for each "partner fuction". We do this generally for a Partner Type. (Please clarify)
    2. If I remove the syntax check box then my PO is not getting created in ME21n transaction.
    3. I have checked the Partner types there is not problem with that.
    Regards,
    Gajanan.

  • Use SQL function to get the original order number using the invoice number

    Hi All,
    wondering is someone can help me with this challenge I am having?  Often I need to return the original order numbers that created the resulting invoce.  This is a relatively simple seriese of joins in a query but I am wanting to simplify it using a SQL function that can be referenced each time easily from with in the SELECT statement.  the code i currently have is:
    Use SQL function to get the original order number using the invoice number
    CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
    RETURNS nvarchar(200)
    AS
    BEGIN
    DECLARE @OrderList nvarchar(200)
    SET @OrderList = ''
    SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
    FROM  OINV AS T1 INNER JOIN
          INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
          DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
          RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
          ORDR AS T6 ON T5.DocEntry = T6.DocEntry
    WHERE T1.DocNum = @InvNum
    RETURN @OrderList 
    END
    it is run by the following query:
    Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
    From OINV T1
    Where T1.DocNum = 'your invoice number here'
    The issue is that this returns the order number for all of the lines in the invoice.  Only want to see the summary of the order numbers.  ie if 3 orders were used to make a 20 line inovice I only want to see the 3 order numbers retuned in the field.
    If this was a simple reporting SELECT query I would use SELECT DISTINCT.  But I can't do that.
    Any ideas?
    Thanks,
    Mike

    Thanks Gordon,
    I am trying to get away from the massive table access list everytime I write a query where I need to access the original order number of the invoice.  However, I have managed to solve my own problem with a GROUP BY statement!
    Others may be interested so, the code is this:
    CREATE FUNCTION dbo.fnOrdersThatMakeInvoice(@InvNum int)
    RETURNS nvarchar(200)
    AS
    BEGIN
    DECLARE @OrderList nvarchar(200)
    SET @OrderList = ''
    SELECT @OrderList = @OrderList + (cast(T6.DocNum AS nvarchar(10)) + ' ')
    FROM  OINV AS T1 INNER JOIN
          INV1 AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
          DLN1 AS T4 ON T2.BaseEntry = T4.DocEntry AND T2.BaseLine = T4.LineNum INNER JOIN
          RDR1 AS T5 ON T4.BaseEntry = T5.DocEntry AND T4.BaseLine = T5.LineNum INNER JOIN
          ORDR AS T6 ON T5.DocEntry = T6.DocEntry
    WHERE T1.DocNum = @InvNum
    GROUP BY T6.DocNum
    RETURN @OrderList 
    END
    and to call it use this:
    Select T1.DocNum, dbo.fnOrdersThatMakeInvoice(T1.DocNum)
    From OINV T1
    Where T1.DocNum = 'your invoice number'

  • TDS not getting reversed while downpayment clearing against invoice

    Hi all,
    We have 2 company codes and in India and another in Abroad.
    Suppose In F-48 i did downpaymnet to vendor for 1000rs, here TDS is
    dedeucted say for example 50 rs. After that in F-43, i made an invoice
    for 2000 for the same vendor, here TDS deducted 100rs. Now in F-54, i
    did downpayment clearing against the invoce, the TDS amount 50rs got
    reversed which was deducted at the time of downpayment.
    This is happening properly for my India company code.
    But for the company code which is in abroad, the TDS account is not
    getting accounted. Actually it should behave as per my indian company
    code, but TDS is not getting reverses...TDS account is not coming al
    all for this company code in F-54.
    I have checked all the configuration and everything is perfect.
    Pls through someligt on this what could be the rerason weather i
    missed any configuration or any seperate configuration for company
    codes which r not in India??
    Thanks in advance,....
    Regards,
    Sreekanth.

    Hi,
    Thanks for your reply. I am doing the reversal with reference to invoice number only. I forgot to mention this in my original question.
    Thanks

  • Tax deducted twice not getting reversed in F-54

    We make a dowm payment and tds is deducted
    later on we account an invoice then also tds is deducted
    We clear the down payment in F-54 then the tds amt reverses
    in my case tds amt is not getting deducted can any body let me know why and how to rectify this .
    and when i make the down payment andsimulate the transcation it does not show the tds line item
    but when i check the tds gl a/c tds is posted into that a/c
    warm regards
    Manjunath

    Hi,
    It is normal that while F-48 initial screen it will not show the tds amounts. But it posts.
    Use business place/section code in all the transactions. It will reverse. We too had the same problem.
    Assign points, if useful.

  • How to get total of any field in sapscript?

    Hello ,
    i m making sapscript...
    How to get total of any field in sapscript?

    Hi
    Yes, you can define a variabe in your print program and pass it to the SAPScript.
    LIKE:
    Define L_SUM in the Global data.
    DATA: L_SUM TYPE BSEG-DMBTR.
    LOOP AT ITAB.
    L_SUM = L_SUM + ITAB-AMOUNT.
    ENDLOOP.
    CALL FUNCTION 'WRITE_FORM'
    WINDOW = 'MAIN'
    ELEMENT = 'TOTAL'.
    Now, in your SAPScript, create a text element in MAIN window
    /E TOTAL
    Total,, &L_SUM&.
    Go through below link
    http://sap-img.com/sapscripts/sapscript-how-to-calculate-totals-and-subtotals.htm
    Regards,
    Chandru

  • How to get the GTRID in string form

    Hello,
    I would like to include the Global Transaction Identifier (GTRID) in my
    application level logs. Preferrably it will be in the same format as it is
    in the ULOG.
    Is there a function to get the GTRID?
    Once retrieved, is there a function to convert the GTRID into a string
    equivalent to how it is presented in the ULOG?
    We are using WLE 5.x (Corba).
    Thanks...
    Roger
    Roger W. Fischer
    North Vancouver, BC

    Tuxedo uses GTRIDs internally, but externally documented functions make use
    of XIDs, which is the official transaction ID format used in the XA
    standard. (tpsuspend() and tpresume() make use of TPTRANID, which is
    another internal data structure.)
    The best approach would be to use userlog() for your application logging, in
    which case you will get the GTRID as part of your log message whenever it is
    present.
    If you want to use XIDs, you can call
    tx_info(&traninfo);
    to get a binary XID and you can format this XID to a string format using
    tpconvert(string_xid, &traninfo.xid, TPTOSTRING|TPCONVXID);
    It is possible to pass this string_xid as a key field in a call to the
    T_TRANSACTION MIB class, and TA_GTRID will be among the returned FML fields,
    but the TA_GTRID MIB attribute is not officially documented.
    "Roger W. Fischer" <[email protected]> wrote in message
    news:[email protected]..
    Hello,
    I would like to include the Global Transaction Identifier (GTRID) in my
    application level logs. Preferrably it will be in the same format as it is
    in the ULOG.
    Is there a function to get the GTRID?
    Once retrieved, is there a function to convert the GTRID into a string
    equivalent to how it is presented in the ULOG?
    We are using WLE 5.x (Corba).
    Thanks...
    Roger
    Roger W. Fischer
    North Vancouver, BC

Maybe you are looking for

  • IOS 6 has just made my iphone 4 unbearable to use, Please Help!

    Hello, I have updated my iphone 4 to the latest iOS 6 software. Now, everything has become extremely slow to use, my volume buttons no longer work. I have to click my home page/lock button numerous times for them to work. Is there anything I can do o

  • Additional Data in Contract creation

    Hi, I had added some fields in additional data B. Earlier in additional data B all fields were visible, but after adding new fields (3  rows have been added) then the last three rows in additional data B have become invisible. In the Additional data

  • Date Logic Question

    I need to create an online retail sales report that compares sales from one year to sales from the prior year. The start date and end date are selected by the user. The report comes in two comparison types: 1. date range for date range (i.e. 6/1/05 -

  • Change Sharing & Permission on External NTFS drive?

    I have an external hard drive that was originally used with a windows machine (NTFS format). How can I change the Sharing & permissions to allow me to modify the drive?

  • How can we optimize the LIKE '%...%' to make it work more efficiently

    how can we optimize the LIKE '%...%' to make it work more efficiently