Length function in rpad

Hi All,
I am calling the following xdofx method like
<?xdofx:rpad(RS_FLEX_VALUE,length(RS_FLEX_VALUE),' ')?>
but in output, the field value is not padding with desired value.
Can anyone suggest me the syntax to get length of the xml tag?
Thanks,
Sai

Thanks BIUser.
Actually I am using the rpad to display the number at leftside while data is displaying in excel sheet.
And because of rpad there is some extra space also adding the to the text data in excel sheet fields. Client does not need that extra space in excel sheet.
Is there any format mask to display all the data in excel sheet as text only(All the data should be left aligned and no extra space).
Can you please help on this?
Thanks,
Sai

Similar Messages

  • LENGTH function for a large number returns 40 not the number of digits

    In SQL*Plus:
    SQL> select length(12345678901234567890123456789012345678901234567890)lngth
    2 from dual;
    LNGTH
    40
    SQL> select length('12345678901234567890123456789012345678901234567890')lngth
    2 from dual;
    LNGTH
    50
    It seems that the implicit conversion from number to char in the first query causes an unexpected result. From the documentation of the LENGTH function at http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions181.htm#i79330:
    "If you omit fmt, then n is converted to a VARCHAR2 value exactly long enough to hold its significant digits."
    Perhaps Oracle considers that only 40 digits are significant (?)

    Additional reason.
    There is implicit data conversion as like to_char(number).
    SQL> set numwidth 50
    SQL> select 12345678901234567890123456789012345678901234567890 num from dual;
                                                   NUM
    12345678901234567890123456789012345678900000000000
    SQL> select length(12345678901234567890123456789012345678901234567890) numlen from dual;
                                                NUMLEN
                                                    40
    SQL> select to_char(12345678901234567890123456789012345678901234567890) numlen from dual;
    NUMLEN
    1.2345678901234567890123456789012346E+49
    SQL> select length(to_char(12345678901234567890123456789012345678901234567890)) numlen from dual;
                                                NUMLEN
                                                    40
    SQL> select to_char(12345678901234567890123456789012345678901234567890,
      2                '09000000000000000000000000000000000000000000000000')
      3  num from dual;
    NUM
    12345678901234567890123456789012345678900000000000
    SQL> select length(to_char(12345678901234567890123456789012345678901234567890,
      2                '09000000000000000000000000000000000000000000000000'))
      3  num from dual;
                                                   NUM
                                                    51
    SQL> select to_char(12345678901234567890123456789012345678901234567890,
      2                'fm09000000000000000000000000000000000000000000000000')
      3  num from dual;
    NUM
    12345678901234567890123456789012345678900000000000
    SQL> select length(to_char(12345678901234567890123456789012345678901234567890,
      2                'fm09000000000000000000000000000000000000000000000000'))
      3  num from dual;
                                                   NUM
                                                    50

  • Length function?

    Is there a Length function in iSQL?
    I'm trying to create the following query in TOAD
    select A
    From B
    Where length(A) = 11
    Order By A
    but, as long as I have the Where clause in there, it complains about "Invalid Column Name". I tried "len" instead of "length", but no improvement.
    Your help is appreciated.

    You have a syntax error in the column name perhaps?
    example of use of length function:
    SQL> select table_name
      2  from dba_tables
      3  where length (table_name) = 1 ;
    TABLE_NAME
    T

  • Confusion with length function ... ?

    I have avery basic question, i have a table ( Item Master ) in oracle which has a field called Item, which is declared as CHAR(50)
    now this field contains data as
    ITEM
    Car
    Pencil
    Televsion
    There are some 5,00,000 records in this table and i would like to find the length of data.
    For example when i execute the new proposed query it should give me output as
    ITEM          LENGTH
    Car          3     
    Pencil          6
    Televsion     9
    but currently when i execute the below mentioned query , it gives me output as mentioned below which i dont want
    select itemcode, length(itemcode) from itemmaster;
    Item          Length
    Car          50
    Pencil          50
    Televsion     50
    sorry i am new to oracle syntax, i tried to locate the excact function , but could not find :-(

    how do i display only top 10 records descending by character length
    SQL> select   object_name, len
      from   (select   object_name,
                       length (object_name) len,
                       row_number () over (order by length (object_name) desc) rn
                from   all_objects
               where   owner = 'SYS')
    where   rn <= 10
    OBJECT_NAME                           LEN
    RESOURCE_STORAGE_POOL_MAPPING$         30
    I_WRI$_OPTSTAT_H_OBJ#_ICOL#_ST         30
    APPLY$_CONSTRAINT_COLUMNS_UIX1         30
    V_$PGA_TARGET_ADVICE_HISTOGRAM         30
    I_FGR$_FILE_GROUP_EXPORT_INFO1         30
    APPLY$_CONSTRAINT_COLUMNS_IDX1         30
    GV_$RSRC_CONSUME_GROUP_CPU_MTH         30
    GV_$CONTROLFILE_RECORD_SECTION         30
    GV_$FLASHBACK_DATABASE_LOGFILE         30
    GV_$PGATARGET_ADVICE_HISTOGRAM         30
    10 rows selected.

  • Doubt in length function

    I am beginner in PL/SQL.The Following statement returns only 40 thugh the exact length is 91.
    SELECT
    length(1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950)
    FROM dual
    Also, I get the same result whenever the input number's length exceeds 40. It is working successfully if the input numbers length is below 40.
    I am using PL/SQL developer.
    Please suggest

    You need to use quotes when using character data in SQL:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> SELECT
      2  length(1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950)
      3  FROM dual;
    LENGTH(1234567891011121314151617181920212223242526272829303132333435363738394041
                                                                                  40
    SQL> SELECT
      2  length('1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950')
      3  from dual;
    LENGTH('123456789101112131415161718192021222324252627282930313233343536373839404
                                                                                  91

  • Problem in substing & length functions

    select substring('hello',1,2) from dual ---
    some times it works... ...
    but some other time it shows the error like this
    ....select substring('hello',1,2) from dual
    ERROR at line 1:
    ORA-00904: "SUBSTRING": invalid identifier
    Why it soooooooo??????
    Thanks

    login to sqlplus and run the following query
    select owner, object_name, object_type from all_objects
    where object_name like '%SUBS%'
    Is there a FUNCTION named SUBSTRING?
    p.s. CD, haven't had anything to eat (or drink) yet&#9786;

  • Substring Function without the length!

    I know I have seen this before, but cannot find it when searching.
    I need to do something similar to the Substring function, where I start from position 4, but the length behind this position is variable.   Due to the IDOC it only passes the value...
    I think I possibly saw a UDF for this somewhere - unless I can use some standard mapping!
    It is probably very simple - but it is late in the day and my eyes are square!  = )
    <i> I need a drink......</i>
    Can anyone help?
    Message was edited by:
            Barry Neaves

    For substring function, you have 1 input and 2 parameters (you set the parameters by double-clicking the function box).
    I also didn't understand how you can pass the output of length function two 2nd parameter of substring function (since it is a parameter and not an expected input).
    You could always create a UDF...
    public String UDSubstring(String a,String b,String c,Container container){
      int d = Integer.parseInt(b);
      int e = Integer.parseInt(c);
      if ((e == 0) && (a.length() >= d)) {
        return a.substring(d);
      else if ((e > d) && (a.length() >= e)) {
        return a.substring(d, e);
      else return "";
    They don't bite, you know...
    Regards,
    Henrique.
    <b>Edit:</b> followed by Michal's correction...

  • Rpad alternate function

    Hi All,
    Can anyone tell me is there any alternate function for rpad in pl sql.I am using rpad in my application but there seems to be some problem as the query is returning some data but in the front end , it is showing as null.

    REGEXP is available from oracle 10g , its not present in 9i.
    Please check out for the alternative here -
    Possibility of installing regexp for 9i
    Hope this helps -
    tempdbs :)
    www.dwforum.net

  • RPAD in UNIX???

    Hi,
    I am not able to concatenate a whitespace with some values in unix.
    For example:
    i have two variables which i want to concatenate with whitespace between them.
    a='john'
    b='wins'
    i want to concatenate both variables so that the result should be "john wins". I want a white space of particular length between them.
    How can we do this in UNIX. Ideally i want the functionality of RPAD (sql) in unix.
    if i do echo "$a""$b" it just combines them but i need a space of particular length in between them.
    Thanks
    Sandeep

    user340 wrote:
    Hi,
    I am not able to concatenate a whitespace with some values in unix.
    For example:
    i have two variables which i want to concatenate with whitespace between them.
    a='john'
    b='wins'
    i want to concatenate both variables so that the result should be "john wins". I want a white space of particular length between them.
    How can we do this in UNIX. Ideally i want the functionality of RPAD (sql) in unix.
    if i do echo "$a""$b" it just combines them but i need a space of particular length in between them.
    Thanks
    SandeepThis has absolutely nothing to do with Oracle. However, why not
    $ a='john'
    $ b='wins'
    $ echo $a
    john
    $ echo $b
    wins
    $ echo $a " " $b
    john wins

  • How to count  the length of a  collection in JSTL?

    Hi ,Everyone.
    I want to count the length of a collection in JSTL.
    For example:
    <c:out value="${length(ownerList)}" />
    the program compile wrong. Is length function supported in JSTL?
    Thanks in advance!

    Use:
    <c:out value="${fn:length(ownerList)}"/>You'll have to include the functions taglib to use the function:
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

  • Transformation File - Usage of Len function in Mapping-

    Hi,
    I am trying to load the data from  flat file to bpc 7.  
    I have maintained a Transformation file, under the mapping options iam using the following condition
    Mapping:
    Account = if (LEN(Col(7)) = 4 then Col(7) +str(.) +*Col(5) ; *Col(7) = *Str (  ) then *Col(5) + *Str(.) + *Col(17); *Col(5) + *Col(4))
    Iam trying to check whether column 7 has four characters in the first condition, but it does not work and action 1 is never reached. Iam not sure whether  length function can be used in bpc  and also There are no errors during validation, but when i run this package transformation for the Account Field does not happen.
    It gives the message "Argument Length must be greater or equal to  zero".  I have tried many ways but the same error message is displayed.
    Is the above mapping correct and is there any other way to check for the length of a field and make comparison ?
    Any quick help is highly appreciated.
    Advances thanks !!!!!!
    Edited by: N. Thanveer Ahmed on Aug 22, 2009 7:02 PM
    Edited by: N. Thanveer Ahmed on Aug 23, 2009 9:45 PM

    removed
    Message was edited by:
    Marc Kelderman

  • Setting max length of the field when using Context Model Node

    I have created a model using Import Adaptive Web Service model option (a web service was a wrapper around SAP BAPI function module).
    There were no dictionary types created in the Local dictionary as a result of import.
    I have mapped the context of the controller to the model node.
    One of the fields in the model is name     CUSTOMER_NUMBER type string;
    Corresponding element in the wsdl of the web service is
    <xsd:element name="CUSTOMER_NUMBER" type="tns:char10" />
    I have created a view with the input filed mapped to the CUSTOMER_NUMBER field of the model node.
    When I type more than 10 chars into the field and hit the search button, I get a com.sap.dictionary.runtime.Ddcheck exception that the length of the field should be less than 10 chars.
    How can I set the max length of the field in design time to prevent runtime exception?
    Thanks,
    Julia

    Thank you for your reply.
    Java trim function will trim the white spaces only, not the characters.
    I can code check length functionality before calling execute function (the function that call the web service).
    I can also create a dictionary structure based on the model structure; create a context value node based on the dictionary structure and use WDCopyService API to move the data between value node and model node.
    I was looking for the best practice...
    When importing model based on Adaptive RFC, the dictionary structures are imported together with the model. This does not happen for Adaptive web service - hence there is a need to add coding for simple checks.
    Julia

  • Using substring function with error

    Hi Guys,
    I have a source field with 1200 characters which need to map to multiple target segments for  132 count of this source field.
    This is not a mandatory field so it sometimes come without any value.
    I am using substring function to breakout the string for every 132 characters and mapped to the target segments.
    There are two problems, first it seems that if source is blank, there will be error.
    Second, if source field come with only eg. 300 characters, error will also occurs.
    I have searched thru SDN and try some of the UDF but to no avail.
    Appreciate your guidance on this problem.
    Regards
    FNG

    H Rahul,
    I have tried your quote but face some syntax error as follows
    Function calculate, Line 6:
    cannot find symbol symbol  : method length() location: class java.lang.String[] j = input.length();       
    Function calculate, Line 26:
    cannot find symbol symbol  : method subString(int,int) location: class java.lang.String[]           
    result.addValue(input.subString(0,EndIndex));                                      ^
    Function calculate, Line 34:
    cannot find symbol symbol  : method subString(int,int) location: class java.lang.String[]                result.addValue(input.subString(StartIndex,EndIndex));                                              ^
    Function calculate, Line 40:
    cannot find symbol symbol  : method subString(int,int) location: class java.lang.String[]                result.addValue(input.subString(StartIndex,EndIndex));                                              ^ Note: /usr/sap/D03/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd66a3a60002911e09ba9e41f132d6b68/source/com/sap/xi/tf/_MM_MT_COMS_TO_ZME_CRE_CHG_CONTRACT_.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /usr/sap/D03/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd66a3a60002911e09ba9e41f132d6b68/source/com/sap/xi/tf/_MM_MT_COMS_TO_ZME_CRE_CHG_CONTRACT_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 4 errors

  • How do you start a function without a button?

    I currently have an action that starts with a button click. But I want it to start on frame 1 automatically without a button. How do I need to edit my code to make this work correctly? It's a typewriter effect and I plan on exporting it out as a .MOV and importing it into Adobe Premiere. I also need to figure out how to get the background transparent if possible. Thanks in advance!
    Here is what I have.
    Button to start the action
    btn.onRelease = function()
        txt_ani.startTypeEffect();
    Typewriter function
    typewriter effect
    // clear the string
    //txt.text = "";
    // stop the page
    stop();
    // the text string
    // use \n for line breaks
    var _txt:String = "“This is the text that will start after you press the button, but hopefully it will start automatically soon”";
    var _tmr:Number; // timer
    var _sec:Number = 62; // milliseconds till next letter
    var i:Number = 1;
    var l:Number = _txt.length;
    function TypeEffect() : Void
        if( i < l )
            txt.text = _txt.substr( 0, i );
            i++;
        } else {
            txt.text = _txt;
            clearInterval( _tmr );
            trace("\t< FIN >");
        //trace( i );
    // call this function to start:
    function startTypeEffect() : Void
        trace("\t< START >");
        _tmr = setInterval( TypeEffect, _sec );

    My movie has 1 frame. I deleted the layer that had the button, so I have an AS layer with the following code in it.
    txt_ani.startTypeEffect();
    And a layer below it with my movie clip with the Function code on one layer and the text in another layer below it.
    When I do play it, nothing happens. But when I add some frames to the movie, it starts after a delay, but I keep seeing "START" in my output tab due to the Trace I have, which makes the text appear very quickly. I think I may need some code to stop it from restarting.
    Where should this code you provided be put? And do I need additional code to have the text not speed up?

  • How to calculate length of textfield

    Folks,
    Please tell me how to find of length of textfield in a form. length function of javascript doesn't work on rawValue.
    Thanks,
    Manish

    Hi Manish,
    Can you post your code what you tried?
    If it is a text field, this.rawValue.length should work. What type of field is it?
    Keep in mind that when nothing has been filled in, rawValue.length is nothing.
    cheers,
    Noë

Maybe you are looking for

  • How to delete pics from desktop

    I accidently moved all my iphotos to the desktop ( copies ) and want to delete them.. i get an pop up message saying they're being used in another application.. do i want to continue? There's 9000 of them, and is there a quick way to delete them, ins

  • IPod nano won't recharge

    I have a 8Gb 2nd generation nano. I've had it for a month with no issues until last week. Last week, it stopped recharging. It wouldn't charge with an AC adapter or when connected to a PC via a USB cable. It would only charge, briefly, when syncing w

  • Weired issue odd IP's can ping the VIP and even can't!

    Hello experts! we have two nexus 9k core, attached to the HP Blade v7000 chasis and VPC configured. All Vlans are HSRP are configured. VPC is configured successfully. But the weird this is that source IP address 10.1.2.3 can ping the dest VIP (on the

  • Connecting Imac to Emac

    Can anyone advise me on the best way to connect an Emac (osx 10.3.9) to an Imac (10.4.7) to access both hardrives and transfer files Thanks

  • Convert to PDF in right-click menu?

    Hi, I just installed Acrobat X and can't find that function which I used a lot in Acrobat 9, ie I could select several jpeg files and then click "convert to pdf" in the right click menu and now that button is gone. How do I get it back?