Concatenation of number and character

Hi,
Can anyone give me an advice
while i am developing an interface which has one number column,
Into that number column i have to insert the number formated data with concatenation of characters.
Ex: trunc(123/89) || 'a'|| mod(345,56) || 'b'
Like the above format i am giving to a number column then i am getting error like
Error:Java.lang.numberformatExcpetion.
Thanks in advance,
Regards.

Hi ,
If the datatype is number means you cannot insert a character.
Make that column datatype as Varchar and try.
Thanks,
Ananth

Similar Messages

  • Query to separate the number and character

    Hi,
    I have the string like '1000xyza' and query should return 1000 only.
    example data:
    source string = '1000xyz'
    output = 1000
    source string = '1000 xyz'
    output = 1000
    I need to use this logic in trigger, and currently I'm checking character by character in for loop to get number and it is taking long time to execute.
    Please suggest better way
    Thanks for help
    Thanks,
    Vijay

    maybe this will somehow help.
    SQL> With virtual_table AS
      2    (Select '1000xyz' str From dual
      3     Union All
      4     Select  '1000 xyz' str From dual)
      5  select vt.str,
      6         trim(translate(vt.str,'1234567890 ',' ')) char_string,
      7         translate(vt.str,translate(vt.str,'1234567890',' '),' ') numbers
      8    from virtual_table vt;
    STR      CHAR_STRING NUMBERS
    1000xyz  xyz         1000
    1000 xyz xyz         1000
    SQL>

  • Dbms_crypto package for number and date data type

    Hi,
    I am using Oracle 10g 10.2.0.3 on Linux 64 bit
    I am tryiing to use dbms_crypto package for the first time to encypt my tables column
    Following are my table columns
    NAME1 VARCHAR2(2000),
    ID1 NUMBER,
    SCORE number
    This table is already populated
    i want to encrypt Name1 and Score column. Following are the functions i have created for Encryption and decryption.
    --For Encryption
    create or replace function get_enc_val
    p_in in varchar2,
    p_key in raw
    return raw is
    l_enc_val raw (2000);
    l_mod number := dbms_crypto.ENCRYPT_AES128
    + dbms_crypto.CHAIN_CBC
    + dbms_crypto.PAD_PKCS5;
    begin
    l_enc_val := dbms_crypto.encrypt
    UTL_I18N.STRING_TO_RAW
    (p_in, 'AL32UTF8'),
    l_mod,
    p_key
    return l_enc_val;
    end;
    --For Decryption
    create or replace function get_dec_val
    p_in in raw,
    p_key in raw
    return varchar2
    is
    l_ret varchar2 (2000);
    l_dec_val raw (2000);
    l_mod number := dbms_crypto.ENCRYPT_AES128
    + dbms_crypto.CHAIN_CBC
    + dbms_crypto.PAD_PKCS5;
    begin
    l_dec_val := dbms_crypto.decrypt
    p_in,
    l_mod,
    p_key
    l_ret:= UTL_I18N.RAW_TO_CHAR
    (l_dec_val, 'AL32UTF8');
    return l_ret;
    end;
    Key: I have stored a key in other schema and calling it by using function get_key().
    Following is my insert
    INSERT INTO Score_table VALUES
    (get_enc_val('John',get_key()),25,get_enc_val(79,get_key()))
    it is giving me following error
    ORA-00932:Inconsistent Datatypes:Expected number got binary.
    I checked, it is an error due to Score field, which is of number type. So do i need to change type of Score field to varchar or is there any other way to encrypt number and date field.
    If i need to change the type then what will happen to the data already in Table and how do i encrypt data already in table.

    Hi,
    Is there any one who can tell me that, do i need to change my table column data type as the encrypted value will be character.

  • JSF and Character Sets (UTF-8)

    Hi all,
    This question might have been asked before, but I'm going to ask it anyway because I'm completely puzzled by how this works in JSF.
    Let's begin with the basics, I have an application running on an OC4J servlet container, and am using JSF 1.1 (MyFaces). The problems I am having with this setup, is that it seems that the character encodings I want the server/client to use are not coming across correctly. I'm trying to enforce the application to be UTF-8, but after the response is rendered to my client, I've magically been reverted to ISO-8859-1, which is the main character set for the netherlands. However, I'm building the application to support proper internationalization; which means I NEED to use UTF-8.
    I've executed the following steps to reach this goal:
    - All JSP files contain page directives, noting the character set:
    <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>I've checked the generated source that comes from the JSP's, it looks as expected.
    - I've created a servlet filter to set the character set directly on the request and response objects:
        public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
            // Set the characterencoding for the request and response streams.
            req.setCharacterEncoding("UTF-8");
            res.setContentType("text/html; charset=UTF-8");       
            // Complete (continue) the processing chain.
            chain.doFilter(req, res); 
        }I've debugged the code, and this works fine, except for where JSF comes in. If I use the above situation, without going through JSF, my pages come back UTF-8. When I go through JSF, my pages come back as ISO-8859-1. I'm baffled as to what is causing this. On several forums, writing a filter was proposed as the solution, however this doesn't do it for me.
    It looks like somewhere internally in JSF the character set is changed to ISO. I've been through the sources, and I've found several pieces of code that support that theory. I've seen portions of code where the character set for the response is set to that of the request. Which in my case coming from a dutch system, will be ISO.
    How can this be prevented? Can anyone give some good insight on the inner workings of JSF with regards to character sets in specific? Could this be a servlet container problem?
    Many thanks in advance for your assistance,
    Jarno

    Jarno,
    I've been investigating JSF and character encodings a bit this weekend. And I have to say it's more than a little confusing. But I may have a little insight as to what's going on here.
    I have a post here:
    http://forum.java.sun.com/thread.jspa?threadID=725929&tstart=45
    where I have a number of open questions regarding JSF 1.2's intended handling of character encodings. Please feel free to comment, as you're clearly struggling with some of the same questions I have.
    In MyFaces JSF 1.1 and JSF-RI 1.2 the handling appears to be dependent on the raw Content-Type header. Looking at the MyFaces implementation here -
    http://svn.apache.org/repos/asf/myfaces/legacy/tags/JSF_1_1_started/src/myfaces/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java
    (which I'm not sure is the correct code, but it's the best I've found) it looks like the raw header Content-Type header is being parsed in handleCharacterEncoding. The resulting value (if not null) is used to set the request character encoding.
    The JSF-RI 1.2 code is similar - calculateCharacterEncoding(FacesContext) in ViewHandler appears to parse the raw header, as opposed to using the CharacterEncoding getter on ServletRequest. This is understandable, as this code should be able to handle PortletRequests as well as ServletRequests. And PortletRequests don't have set/getCharacterEncoding methods.
    My first thought is that calling setCharacterEncoding on the request in the filter may not update the raw Content-Type header. (I haven't checked if this is the case) If it doesn't, then the raw header may be getting reparsed and the request encoding getting reset in the ViewHandler. I'd suggest that you check the state of the Content-Type header before and after your call to req.setCharacterEncoding('UTF-8"). If the header charset value is unset or unchanged after this call, you may want to update it manually in your Filter.
    If that doesn't work, I'd suggest writing a simple ViewHandler which prints out the request's character encoding and the value of the Content-Type header to your logs before and after the calls to the underlying ViewHandler for each major method (i.e. renderView, etc.)
    Not sure if that's helpful, but it's my best advice based on the understanding I've reached to date. And I definitely agree - documentation on this point appears to be lacking. Good luck
    Regards,
    Peter

  • Are there any plans to fix the misinterpretation of the Exchange ActiveSync policy "Minimum number of character sets"  in IOS6?

    We are testing using IOS6 in our Corporate environment and came across a scenario where IOS6 incorrectly interprets the Exchange 2010 ActiveSync policy "Minimum number of character sets" as the number of special characters required rather than the number of character sets required. Is anyone aware of any plans to correct this in future releases? Here is a thread on Microsoft's forums about the issue:
    http://social.technet.microsoft.com/Forums/en-US/exchangesvrmobility/thread/fe05 1d55-24ba-45e4-b054-67861f28422d/

    We have tried Android, Windows Phone7/8 and they all adhere to the "Minimum number of character sets" set in the ActiveSync policy, but IOS does not.
    Require an alphanumeric password   Select this check box to require device passwords to contain both numbers and letters. The default is numbers only.
    Passwords must include this many character sets   To enhance the security of device passwords, you can require passwords to contain characters from multiple character sets. Select a number from 1 to 4. The sets are letters, uppercase letters, numbers, and symbols. For example, if you select 3, passwords must contain characters from three of these sets.
    All other mobile device except IOS 5.x/6.X don't follow this.
    You have to select "Require an alphanumeric password" which is letters and numbers.  But then you can only select 1-4 for the character sets. 
    So we set it at 1, so that would mean you would only need letters and numbers, IOS does not reconize letters, letters uppercase, numbers or symobols as a charator set, it interprets the setting as how symbols you need.
    If you set it at 2, then IOS makes you have "2" symbols in your password.....and so on...
    Make sense?
    It just seems that IOS does not reconize charator sets, it just looks at the number as how many symbols you need in a password.

  • Are there any plans to fix the misinterpretation of the Exchange ActiveSync policy "Minimum number of character sets"  in IOS5?

    We are testing using IOS5 in our Corporate environment and came across a scenario where IOS5 incorrectly interprets the Exchange 2010 ActiveSync policy "Minimum number of character sets" as the number of special characters required rather than the number of character sets required. Is anyone aware of any plans to correct this in future releases? Here is a thread on Microsoft's forums about the issue:
    http://social.technet.microsoft.com/Forums/en-US/exchangesvrmobility/thread/fe05 1d55-24ba-45e4-b054-67861f28422d/

    Thanks for the responses. I did submit this issue as a bug report earlier this morning also but thought I'd post here in the event any Apple insiders saw this and cared to comment. 
    This really is a significant problem in that our testing shows that the way IOS5 interprets this ActiveSync policy in Exchange 2010 does not allow you to enforce a password using just letters and numbers. This is because  the only valid values for this policy are 1-4. The way IOS5 interprets this requires 1-4 special characters in the password, not 1-4 character sets.

  • Limit number of character in a TextArea

    Hi,
    how can I limited the number of character in a jTextArea?
    thanks!

    You have to customize the Document that your text area is using. You can read more about the Document interface here:
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/text/Document.html
    And here is a simple example that demonstrates how you can customize a Document to do what you want. The program should compile and run as is. It will display a JTextArea that only allows ten characters.
    import javax.swing.*;
    import javax.swing.text.*;
    public class LimitedTextArea extends JFrame {
        public LimitedTextArea() {
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            JTextArea text = new JTextArea(5, 40);
            // Set the customized Document on the text area. Only allow
            // a maximum of ten characters:
            text.setDocument(new LimitedDocument(10));
            getContentPane().add(new JScrollPane( text ));
            pack();
            setLocationRelativeTo(null);
        public static void main(String[] args) {
            new LimitedTextArea().setVisible(true);
        // Document that only allows a certain number of characters
        class LimitedDocument extends PlainDocument {
            private int maxLength;
            public LimitedDocument(int maxLength) {
                this.maxLength = maxLength;
            // This method is overriden from the super class. It will be called when
            // you are trying to insert text in your text component (by typing
            // or pasting).
            public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
                int currentLength = getLength();
                if( currentLength >= maxLength ) {
                    // There's not room for more characters. Return.
                    return;
                if( currentLength + str.length() > maxLength ) {
                    // All of the characters we are trying to insert will not fit.
                    // We must trim the string.
                    str = str.substring(0, maxLength - currentLength);
                // Insert the text:
                super.insertString(offs, str, a);
    }

  • String to number and Number to String Problem!

    Hi All,
    In my report i ahve to display the Date.
    From DB i am getting 4 digit string( 2008). Using that i have to display as 08 - 09
    In that i used RIGHT function. it is diplayed as 08 - 9.
    when i take 2 character from right '08' is coming. Then i converted to number and added 1 to the year
    But it become 9 instead of 09.
    How to solve it.
    Thanks in advance.
    Saravanakumar.

    Hi,
    Shweta's answer is valid when you retrieve a date field from the database, as you have specified that you are getting a four digit string, you should use this formula.
    if length(totext(tonumber(right('2008',2))+1)) = 4
    then
    right('2008',2)'-0'left(totext(tonumber(right('2008',2))+1),1)
    else
    right('2008',2)'-'left(totext(tonumber(right('2008',2))+1),2)
    hope this helps!!!
    Thanks
    -Azhar
    Edited by: Abdul Rehman Mushtaque on Mar 29, 2009 10:29 AM

  • Merging of Prodn Order number and operation number into the unloading point

    Hi,
    I am creating the production order using the Tcodes Co01 or co10 and my requirement is that after creating the production number and then when I open that one in the change mode using co02 Tcode the unloading point which is present in the Goods Receipt tab should come as a concatenation of order number and operation number .
    Thanks for the help in advance.
    Regards,
    Venkat.

    Hello Rachit,
    The relation is as follows
    AFKO-AUFPL (Routing number is Order header)
    Use this routing number to get operations from AFVC
    AFVC-VORNR gives operation number
    AFVC-LTXA1 gives operation description
    For sub-operations, VORNR will be sub-operation number, and AFVC-SUMNR for this sub-operation corresponds to the respective superior operation(refers to AFVC-APLZL).
    AFVC-APLZL is a unique number for each operation.
    Hope this helps. You can check with some existing/new orders as well.
    let me know if you need anything about split operations as well.
    Best Regards,
    Subhakanth

  • How do you get a word and character count of a document in Pages for Mavericks

    How do you get a word and character count of a document in Pages for Mavericks?

    Hi jonathan,
    I struggled with this one as well, as i'm finishing up a PhD thesis and word counts are incredibly important. Through trial and error i found out that words like 'e.g.' and 'i.e.' count as two words and an ampersand (&) doesn't count at all. That being said, i didn't like the fact that the word count always included footnotes and i was dismayed that i couldn't get an accurate count of words in the main body of my text. That all disappeared yesterday when, by chance, while i was copying a completed chapter and pasting it into my main document, i discovered that Pages can indeed give you an accurate word count excluding the footnotes!  Here's all you need to do:
    1. In pages 5.2, make sure that the Word Count function is first enabled by selecting View --> Show Word Count from the Pages Menu Bar. (If it's already enabled, it will read View --> Hide Word Count, so if that's what it says, then no need to do anything.)
    2. Once enabled, check the Word count that's currently showing at the bottom of the page. That's the word count including your footnotes.
    2. Now, place your cursor anywhere within the current document, then hit command+A (for Select All).
    3. Viola! Your word count now shows the actual number of words within the body of the text only, excluding footnotes!
    Hope that helps!

  • Assigning large number if character to a Codepage

    Do  we have a tool / process  which can assign large number of character to a code page, which cannot be done by SAP SPUM4. There are 18 languages and 10 code pages.
    Languages listed below,
    French,English,German,Italian,Spanish,Portuguese,Bulgarian,Japanese,Chinese,Danish,Russian,Dutch,Finnish,Malaysian,Czech,Hungarian,Norwegian,Swedish
    we run SPUM4 in our Development Environment and found 450.000 words without a language associated. This corresponds to 2,5 months of movements from our ERP  productive clients. After applying a dictionary and language patterns provided by SAP, we have now 274.000 words left (and 150.000 duplicates).  I need to find other ways to decrease this number so that I end up with a workable list of words.

    There is no method but assigning them more or less manually or using hints.
    You may check for special characters in languages, e. g. the polish ł will be displayed as ³ when you login in English - although this may also be a different character.
    We had the same "problem" with 8 languages (including more than one Asian language) so it was cumbersome.
    Markus

  • Word counts and character counts

    Hi,
    I'm using Pages '06. I would like to be able to count the number of words and characters in a paragraph in Pages. I know that if i go to the Document Inspector and click info, it gives me word and character counts for the entire document. Is there a way to do this for individual paragraphs?
    Many thanks.
    Joe.

    After you install WordService (see link in Dennis' post), you can access several new services in the Pages menu. You may have to restart Pages &/or your Mac.
    WordService & CalcService add their functions to any OS X program that has been programed to utilize Services. I've been using them since shortly after I got iWork '05.

  • Merging the Production order number and operation number into sequential no

    Hi,
      I am creating the production order using the Tcodes Co01 or co10 and my requirement is that after creating the production number and then when I open that one in the change mode using  co02 Tcode the sequential number which is present in the assignment tab should come as a concatenation of order number and operation number .
    Thanks for the help in advance.
    Regards,
    Venkat.

    dear,
    this depends on the user buffer set.
    for each user there will be a buffer set in when logeed in and create a production order.
    depending on the saving the production order saving time there may be a situation as you have now.
    discuss with your basis people and under stand the user  buffer of numer for production order.

  • Which method to count the number of character in a string?

    Hi all,
    I want to know which class and method to count the number of character in a string?
    Gary

    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html

  • Get number of character within a String by number of pixels

    How can i get the number of character within a String
    by a width value...
    for example..
    i have a String = "1234567890abcdefghi.........."
    and when i give the width "10"
    i will get the String "12".
    or the number of charcter..
    or somthingggggggggggggggg
    please help..
    Shay

    i solved this...
    by doing somthing similar..
    i made a for loop on all character
    and evrey time i am get a sub string from the 0 till the loop index..
    and i am chashing the last string
    so when a sub width is greater the the requested width
    i am returning the lst cashed result
    thanks.. all..

Maybe you are looking for