Validating a number format

How can I ensure that the user is inputting a 6 digit value. My application should error out if a user inputs anything less that six digits for a number. EX: 18 should produce an error; 000018 should process correctly. Does anyone know how I can validate such input?

Hi,
In the Page Processing section for your particular page, there is a Validations subsection. The simplest thing to do would be to employ an isNumeric function returning boolean such as the one demo'd by Tom Kyte here:
http://www.oracle.com/technology/oramag/oracle/04-jul/o44asktom.html
e.g.
declare
l_number number;
begin
l_number := :P_VAR;
return TRUE;
exception
when others
then
return FALSE;
end;
You could also check the length(:P_VAR) = 6 within your function, and return true or false accordingly.
The Validations wizard also contains placeholders for appropriate error messages.
Does this help?
Regards,
Emilio.

Similar Messages

  • SQL phone number format check

    Hello, I am looking for a programmatic way to check phone number formats in my database using SQL. The phone numbers MUST be one of 2 formats:
    XXX-XXX-XXXX or (XXX)XXX-XXXX
    I want to return the row if they are NOT one of these formats.
    Thank you!

    This?
    SQL> WITH t AS (
      2     SELECT '555-555-1212' phone FROM dual UNION ALL
      3     SELECT '( 555 )555-1212' FROM dual UNION ALL
      4     SELECT '555 555 1212' FROM dual UNION ALL
      5     SELECT '(555)555-1212' FROM dual UNION ALL
      6     SELECT '555 555-1212' FROM dual)
      7  SELECT phone
      8  FROM t
      9  WHERE TRANSLATE(phone, '()-0123456789', '()-') NOT IN ('--', '()-');
    PHONE
    ( 555 )555-1212
    555 555 1212
    555 555-1212If you are on 11g, you could also do something with regexp_like, but personally, I think it would be overkill. If spaces are not invalid as long as the rest meets the format, two parens and a hyphen or two hyphens (i.e. the second one could be valid, but not the third and fifth) then use replace to get rid of spaces first and nvl to deal with nulls like:
    SQL> WITH t AS (
      2     SELECT '555-555-1212' phone FROM dual UNION ALL
      3     SELECT '( 555 )555-1212' FROM dual UNION ALL
      4     SELECT '555 555 1212' FROM dual UNION ALL
      5     SELECT '(555)555-1212' FROM dual UNION ALL
      6     SELECT '555 555-1212' FROM dual)
      7  SELECT phone
      8  FROM t
      9  WHERE NVL(TRANSLATE(REPLACE(phone, ' '), '()-0123456789', '()-'), 'x') NOT IN ('--', '()-');
    PHONE
    555 555 1212
    555 555-1212John

  • International Phone Number formatting

    Hello all,
    I'm wondering if there are any open source phone number formatting libraries out there? The phone numbers can come from anywhere in the world.
    I would get something like this
    0112024444444
    Algeria
    and get
    011 20 (2) 444-4444
    Thanks,
    Ralph

    I'm sure there are, but there's a lot of formats out there. Why not just have a single field and let people put what they want. If it's not a valid number, then they won't get a call.

  • How define a pattern for having a number formatted

    Hello,
    anybody knows how to define a pattern for having an input number formatted in this way:
    150.000.000,88
    I've tried to use the following pattern( pattern="#.#00,00") ...but - of course - It does not work.....
    I'm using Jdeveloper 11.1.1.7
    <af:inputText value="#{pageFlowScope.contractBean.localTot}"
                          label="#{contractBundle.BASE_TOTALE}"
                          columns="12"
                          maximumLength="#{bindings.baseTot.hints.precision}"
                          id="it2"
                          valueChangeListener="#{pageFlowScope.contractBean.baseTotChangeList}"
                          autoSubmit="true"
                          required="true">
                    <f:validator binding="#{bindings.baseTot.validator}"/>
                <af:convertNumber type="number" minFractionDigits="2" maxFractionDigits="2" pattern="#.#00,00"/>
              </af:inputText>  

    Guessing you tried this, but have you tried:
         <af:convertNumber locale="de"  ...
    or
         <af:convertNumber locale="#{requestContext.formattingLocale} ...
    Hope this helps.

  • COPA line item report, Number format  -output type - object list(ALV).

    Hi,
    I am preparing COPA line item report. I want to change number format (two decimal place). I did the changes in form level then I did the changes in drill down report as well and saved as save definition.
    But changes are not reflecting in- output type - object list(ALV).
    Please provide help in this.
    Regards

    HI
    What t-code you are using to write this line item report ?

  • Problem with the number format in the graph axis with Report Generation Toolkit.

    Hi!
    I'm trying to use the Report Generation Toolkit to plot some graphs in Excel.
    My first problem is that I don't know how to configure the number format in the Excel Set Graph Font.vi so that my numbers are correctly displayed in the graph's axis. The only given option is general (0,0) but this is not enough for me, my numbers can get really small so I need engineering notation or fraccional format.
    Second: I also insert a table with the graph source data, but the numbers are not correctly displayed either: for example: 
    0,75 is shown as: 
    0,750000
    but 1,25  is shown as: 
    1!250!000
    My guess is I am making to much or wrong string to number conversions or Excel is getting it wrong but I can't find my way...
    Can someone help me with this?
    Thanks,
    Isabel

    Here is my VI, it's just a trial so it can look messy...
    Thanks,
    Isabel
    Message Edited by Isa_pm on 01-22-2007 01:12 PM
    Attachments:
    Create report.vi ‏96 KB

  • Number formatting issue in Web intelligence report

    Folks ,
    I've an object called ' Serial number' (12 digits long) but when I set this in query filter as a prompt number format gets changed.
    Similar like this:  
    whereas I am expecting to see 123456789123 something like this.
    I made sure that object data type is number while designing universe as well as also format the object ( using format object option) and set as ############. ( 12times #) to forced as 12 digits number.
    When I drag this object in 'result objects' results shows fine but if i add this as 'Query Filters' number gets changed as above pic.
    Any advise ?
    Cheers,
    iTanzir

    Hai Itanzir
    Try to create a dimension variable in universe and choose the data type as string. Please check this and let me know for issues, if any.
    Regards,
    Amala.S

  • Number format issue in XML Publisher from OAF (',.' is replaced by 'u n')

    Hi All,
    I am facing a problem in XML Publisher report. In report I need to display some number fields with 'USD' format. In RTF, data type 'Number' and format '###,##0.00' is selected. If I run concurrent program from oracle core forms using System Administrator > Concurrent > Request, I am able to get correct number format.
    Ex : 123456.00 After Number format : 123,456.00
    Also its working fine from XML Publisher Administrator responsibility (using Preview).
    But problem is when I submit the concurrent request through OAF, I am not getting correct data. ',' is replace by 'u' and '.' is replace by 'n'.
    Ex: 123456.00 In Report 123u456n00
    Checked profile value : ICX: Numeric Character and its set to 1,000.00 at site level.
    Do I need to set character set anywhere in OAF before calling concurrent program?
    I tried to use "alter session set nls_numeric_character = ',.';" by calling stored procedure from OAF. But still its not working.
    Please give me solution for this.
    Regards,
    Sadanand

    Hell - I am running into the same issue? Did you guys find a resolution for this? Please let me know, would really appreciate your help.
    Thanks,
    Dhiraj
    [email protected]

  • How to change number format to international setting

    Hello everyone,
    I need some help on how to change the number format on my phone from the standard US format to an international format with no spacing between the numbers. Currently, my numbers appear as: 0706 343 3456. However, I will like for it to appear as 07063433456. When i recieve calls, the number format is not recognised and I cannot tell who is calling. Same goes for SMS messages. In this part of the world, the number format is not spaced, which is quite frustriating.
    Can anyone please advice me on how to go about this.
    Thanks

    Really? I tried that but it did not work. I restarted the iphone several times but the number format did not change.

  • How to change number format in web reports

    Hi, Experts,
        Simple question, if I want to change the number format on web report as following
    . . . . . . . . Actual
    . . . . . . . . *1000SGD 
      new order   .   341.5
      sales       .   567.45
    if I click "Actual" then select properties, set data format from "in 1000" & "0" to "in 1" & "0.00", nothing changed in web report after refresh.
    if i click one number (for example: 341.5) or "New order" to set data format from "in 1000" & "0" to "in 1" & "0.00", only this row's format is changed, others row still keep old format.
    how to change whole column's data format at once setting?
    thanks in advance.
    Message was edited by: jie miao
    Message was edited by: jie miao

    Hi,
    Logout and login may help you and also Delete the session in SM04  before re login. Some times system will not do complete refresh of data even though you select refresh button.
    With rgds,
    Anil Kumar Sharma .P

  • How do I change the number formatting within a Cell Table in Microsoft Word?

    Hi, I was wondering if someone could help me out on an issue I've been having... I work for an accounting firm and we do a lot of financial statements. 
    I was wondering if we would be able to treat a cell table in Microsoft Word 2007 like I would a cell table in Microsoft Excel. Meaning, I would like to change the formatting of the numbers in the table to the "Accounting" (number) format so it
    aligns by the decimal point and use the $ signs and () for negative numbers.  We do use the link tables feature, however, most of our balancing pages just can't be done in Excel because of the way the text is written. It would be much harder to format
    the text if it were to be typed in Excel. We have also tried  creating an Excel sheet within Microsoft Word but it is the same as linking the tables... Again, a text formatting issue.  The only option is to use tables within Word but how do we change
    the number formatting to a "accounting" (number) format where the numbers would align with the decimal point and use () for the negative numbers. Is there ANY option for us to do this other than manually entering this information in using tabs?  
    If there are no options other than entering it in manually, please consider this as an option for your next software update. I believe that a LOT of people out there will be interested in this feature... My manager and I just attended a webinar on Microsoft
    Advanced Word Tips Tricks and Techniques and 75% of the attending people had this question but no answer.
    Thank you very much for your help!!!!!

    Word does not really have number formatting for table cells. You can align cell contents on the decimal point, though, by setting a so-called decimal tab stop.
    Option 1:
    - Select the cells for which you want to do this.
    - Display the ruler.
    - Click the Tab box on the left hand side of the ruler until the box contains an inverted T with a dot.
    - Click in the ruler where you want the decimal tab.
    Option 2:
    - Select the cells for which you want to do this.
    - Click the arrow in the lower right corner of the Paragraph group on the Home tab of the ribbon.
    - Click the Tabs... button in the lower left corner of the dialog.
    - Specify a tab position in the box, e.g. 1.5".
    - Select the 'Decimal' radio button under 'Alignment'.
    - Click Set.
    - Click OK.
    You will have to type the numbers as they should appear, including the $ for currency and the ( ) for negative numbers.
    Regards, Hans Vogelaar

  • Applying date and number format mask

    I have specified a date format for an attribute and a number format for another attribute of an entity object using Entity Object Editor - Control hints for the attributes.
    The date format is:
    Format type: Simple Date
    Format: dd.MM.yyyy
    The number format is:
    Format type: Currency
    Format: 0,000.00 km
    When using &lt;c:out value="${bindings.MyDate}"&gt;&lt;/c:out&gt; the format mask for the date is applied and it looks good, but when using
    &lt;c:forEach var="Row" items="..."&gt;
    &lt;c:out value="${Row.MyDate}"&gt;&lt;/c:out&gt;
    &lt;/c:forEach&gt;
    the format mask is not applied.
    When it comes to the number format it is not applied no matter what I use.
    I have tried setting the format for the view object attributes as well but the result is the same. How do I make this work?

    Can it have something to do with &lt;html:form&gt; ? Since it works using &lt;c:out value="${bindings.MyDate}"&gt;&lt;/c:out&gt; inside a html:form.

  • I need to reinstall my Acrobat 9. Have a disc and serial number, but when I enter the number I am told it is not a valid serial number. Checked my registration for CS 5 and that is the number. Now what?

    In trying to reinstall the Adobe Pro 9, I keep getting the message that I ado not have a valid serial number. But I am using the number Adobe shows as the number with which I registered the product. Need this program to work. Any advice?

    If it's a CS5 number you need to install with your Creative Suite disks, NOT an Acrobat download.

  • I am changing laptops and have tried to download and install Acobat 9 Standard from the Adobe website, but get message that my serial number is invalid. I log in and double check my account and it shows as a valid serial number.  Now what?

    I am changing laptops and have tried to download and install Acrobat 9 Standard from the Adobe website, but get message that my serial number is invalid. I log in and double check my account and it shows as a valid serial number.  Now what?

    If you had it on a laptop that crashed and you threw away, it is still considered as activated on that machine.  YOu should contact Adobe by chat or by phone and have them deactivate for you.
    Here is a link to a page with options to help make contact:
    http://www.adobe.com/support/download-install/supportinfo/
    If you are getting a message that indicates the serial number is not valid, you should look thru the following:
    Error "The serial number is not valid for this product" | Creative Suite
    http://helpx.adobe.com/creative-suite/kb/error-serial-number-valid-product.html

  • I had Adobe Acrobat Serial loaded before The hard drive crashed on my old PC.  I have tried to download Acrobat 9 on my new PC, but always get the message "This is not a valid serial number".  I had Adobe 9 Standard on the old.  But what downloads from th

    I had Adobe Acrobat Serial loaded before the hard drive crashed on my old PC.  I have tried to download Acrobat 9 on my new PC, but always get the message “This is not a valid serial number”.
    I had Adobe 9 Standard on the old.  But what downloads from the page http://helpx.adobe.com/acrobat/kb/acrobat-8-9-product-downloads.html is Adobe 9 Pro.  Perhaps this Pro version is the problem. 
    Anyway, can you point me to a way to install Adobe on my new PC?

    You can try Download Adobe CS5 Free Trials – All Direct Links without Akamai | ProDesignTools.

Maybe you are looking for