Character field format mask

since Oracle Reports doesn't allow character data format masks, whats the work around to format telephone numbers, etc. without having to store them as a number data type?

You can store the telephone number in the database as a varchar2(12) with the format. Say the user enters 3331114444 then while inserting the value change it to 333-111-4444 and store it. Else in the report convert your telephone number to a number field and format it.
Select to_number(telephone_no) from table;

Similar Messages

  • Text field - format mask

    Hi!
    How can I achieve that tex field will have formated mask like AB12 12345 123 123 1234 (first 2 signs are character - only AB, then there is 17 numbers with space), so when I write in that text filed numbers like 123451231231234 I get AB12 12345 123 123 1234? I don't know if I must use regular expression or something else.
    I use apex 4.1
    Regards,
    drama9346

    You can do this using javascript like in this example:
    http://apex.oracle.com/pls/apex/f?p=31517:127
    However, your requirement is more complicated and will need more coding.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Number field - Format mask and validation

    APEX 4.2.1
    When a page item with source=DB column uses a Number type and a currency format mask (FML999G etc), when the page is rendered, it properly formats the number.
    The built-in Item is numeric validation appears to be handle this reasonably ok. i.e. both formatted values and only-digits both validate ok.
    But any after-submit validations choke on the non-numeric characters in the field! Please don't tell me I have to a) create shadow items and/or b) replace() out the non-numeric characters in the validation.
    After so many years and versions, why doesn't APEX have a simple, declarative, elegant solution to handle such a basic function?
    Am I missing something?
    Thanks

    As described in the item help
    "Select or enter a format mask. Note that format mask is applicable only to items of source type Database Column."
    In my experience, and this goes for the great web experience, not just the application you're designing - I've found the most data entry fields avoid formatting.
    Relevant information is often shown item labels.
    Any occasional the business has specifically asked for formatting, I've taken the same approach as I've needed to for years - before web development (and every time you use the to_date/to_char functions for date conversions) - validate the information as per expectation. If you think the user will be adding punctuation to a numeric field, then you must validate accordingly.
    This usually means adding TO_CHAR(value_entered, expected_format_mask) to your validation control, instead of presuming APEX will read the user's mind and know the content of that numeric field may not be numeric.
    Date entry does the same thing - ultimately there is a session date format that is implicitly used by Oracle to convert an entry of 12-10-2012 to the appropriate date -- ie, is it October or December?
    Have a think about the various websites you visit personally - plane bookings, concerts, ebay, etc - how many expect entry to be purely numeric? My recollection is most, except maybe some credit card fields, but most use some sort of regular expression to sort that out. And you can tell the validation is coded respectively.
    Generally, I reserve this sort of primping to reporting - even then it's made to be subtle - just like I'd prefer makeup to be ;-)
    Most users just care about the data, not how it looks.
    Scott
    blog: [url grassroots-oracle.com]grassroots-oracle.com
    twitter: [url twitter.com/swesley_perth]@swesley_perth
    -- please mark any useful posts as helpful or correct, in the end it helps us all

  • How Can I Change Format Mask For All Fields that type's Number Depend on Parameter in Report Builder 10g ?

    I want Change format mask for all fields that type's number
    Such as
    if  :parameter_value = 1 then
       all fields format mask = ' 999,999,990.000' ;
    else
       all fields format mask = ' 999,999,990.00' ;
    end if;
    Regards

    So, i have bad news for you : you'll have to rebuild again.
    Meanwhile i have excellent news for you : there's an online tool made by Johannes Henseler called Sidecar xml which builds the necessary xml file for you, sort of what you find in the Digital Publishing Folio Editor website, but saves it in your Folio folder.
    Next time you import all your folder (with that file), it will place all the necessary information, and even reorder the articles.
    Build once, play many times.

  • Date format Mask for CHAR datatype

    hi
    i want to assign a format mask like 'dd/mm/yyyy' to a field which has char datatype can i ?

    The quickest answer to your question is to try it! :-) If you click on the Format Mask property of your Text Item and then press F1 Forms will display the Format Mask Help information for this property. All of the valid combinations for a Text Field Format Mask will be displayed.
    To answer your question, you can put a format mask on a Text Item that can enforce the basic format of 'DD/MM/YYYY', but you could get data like: 99/99/9999. You would have to write code in a When-Validate-Item trigger that would ensure the user has entered a valid date.
    Hope this helps.
    Craig...

  • How to set Character field's Format Mask?

    dear all,
    how to set Character field's Format Mask?
    i searched the forum and found the following, where can i use this code and how to change and set its format mask.
    SRW.SET_FORMAT_MASK('mask');
    Thanks
    Muhammad Nadeem

    Nadeem,
    If you have database 10g, look into function REGEXP_REPLACE. Otherwise you can also try this (you might already know).
    SELECT SUBSTR('CHHOCMIPO07020001', 1,2)||'-'||SUBSTR('CHHOCMIPO07020001' ,3,2)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 5,2)||'-'||SUBSTR('CHHOCMIPO07020001' , 7,3)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 10,2)||'-'||SUBSTR('CHHOCMIPO07020001' , 12,2)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 14,4)
    FROM dual
    CH-HO-CM-IPO-07-02-0001
    If you have to use this at many places, create a function, pass the raw value, manipulate the string and return.
    FS

  • How to get a currency format for a character field

    for some specifix reason, we have a requirement to show character field (which results in value 633948) in the format $633,948
    how do i do this?
    if i do SELECT to_char(:c_1,'$999,999')) from dual;
    it gives me ora: 01722: invalid number error
    c_1 is a user parameter of data type character

    Try using TO_NUMBER first, as in something like:
    SQL> VARIABLE c_1 VARCHAR2(6)
    SQL> EXECUTE :c_1 := '633948';
    PL/SQL procedure successfully completed.
    SQL> SELECT TO_CHAR(TO_NUMBER(:c_1), '$999,999') FROM DUAL;
    TO_CHAR(T
    $633,948Hope this helps.

  • Problem Querying Oracle Forms Using a Date Field and a Format Mask

    Hello,
    We are experiencing a problem with Oracle Forms that I was wondering if you can help me with.
    We have several Forms that have single database blocks assigned to Oracle tables. The Forms are queryable and one of the fields we’re querying on is assigned to a field on the base table which is Not Null and has a Type of DATE. We are storing date/time information in this field on the database table. The item on the form is set up as a Date field with a Maximum Length of 7, a Format Mask ‘MMDDYY’ and having a Query Length of 10.
    We’ve seen a discrepancy in how these fields are used to query the base table block. On some user’s computers they are able to enter a 6 digit date followed by the % sign (e.g. ‘091808%’) and they get the expected results. Other users get ‘FRM-40301: Query caused no records to be retrieved. Re-enter’. Do you know why we are experiencing this difference?
    - The Oracle Database version we are running is Release 10.1.0.5.0.
    - The Forms Developer version that we’re experiencing the problem with is 4.5.10.15.2
    Thanks,
    Kris

    There is no obvious reason that I can see.
    Version 4.5 is very old so you might have problems calling Oracle Support. If you can reproduce the same problem o0n 10.1.2 you should call have them analyze the problem.

  • Need Format masks which can be added to oracle form fields

    Hi All,
    I needed a list of all the format masks present for Oracle Forms fields. The problrm that i face currently that when I apply masking (999g999g999d99) the values in the text item field on the form side are no more left justified but shift towards the center of the field. PLease help me out.
    Thanks,
    Gaurav

    Hi Gaurav,
    You are on the wrong forum. Post your question on the Forms forum.
    Regards,
    Andrei

  • Masking of entry fields formatting

    is there any way to mask a field with a particular format. E.g. our national identity number (Social Security Number) in Peopleis in 99999-99999999-9 format and the Supplier's Tax Registration Number is in 999999-9 format.
    Is it possible that we can define these format masks in Oracle EBS? Please note that some forms are Oracle Developer based and some are HTML based.
    Has anyone done such personalizations?
    -- GTA

    Use a font that allows embedding/ check the font embedding settings in the PDF output settings.
    Mylenium

  • Character field with date format alike & character entered

    Hi all,
    I got one character field created ( varchar2 ) for the purposed to let user the enter the date and also any character since it is a character field.
    Hence, my field may contain the following data :-
    Ship_date
    01/10/2010
    07/02/2011
    15/01/2011
    25/01/2011
    31/01/2011
    TBA
    STOP
    11/01/2011
    TBA
    Hence when come to sorting, I will like it to be date format like sorting so that the earlier date will display first then only follow by the character. The expected result will be :-
    ship_date
    01/10/2011
    11/01/2011
    15/01/2011
    25/01/2011
    31/01/2011
    07/02/2011
    STOP
    TBA
    Trying to do the normal sorting, it does not exactly sort on the date format, as it only sort on the first two character on the date hence I am not getting the correct sorting on this.
    01/10/2011
    07/02/2011
    11/01/2011
    15/01/2011
    25/01/2011
    31/01/2011
    STOP
    TBA
    Could someone help me on this. Thanks.
    Lim

    Hi, Lim,
    sm**** wrote:
    Hi all,
    I got one character field created ( varchar2 ) for the purposed to let user the enter the date and also any character since it is a character field.That's a very bad idea. Use a DATE column for storing dates. Have another, separate column for VARCHAR2 data.
    Hence when come to sorting, I will like it to be date format like sorting so that the earlier date will display first then only follow by the character. The expected result will be :-
    If you must deal with the table as it is:
    ORDER BY  CASE
              WHEN  TRANSLATE ( ship_date
                        , '012345678'
                        , '999999999'
                        ) = '99/99/9999'
              THEN  SUBSTR (ship_date, 7)
                 || SUBSTR (ship_date, 4, 2)
           END
    ,       ship_dateThe CASE expressionj sorts anything the looks like a date ('99/99/9999' where '9' stands for any digit) first, in order by the last 4 digits, then the middle 2 digits. The first 2 digits are sorted by the second ORDER BY expression.
    I will like it to be date format like sorting so that the earlier date will display first then only follow by the character. The expected result will be :-
    ship_date
    01/10/2011
    11/01/2011
    15/01/2011
    25/01/2011
    31/01/2011
    07/02/2011That must be a mistake. I don't believe you want January to come after October and before February, but if you do, you can change what comes after THEN in the CASE expression.

  • Changing the format mask of a numberic field in a  report

    Hi,
    I'm fethcing some numeric values from the DB and displaying them in the report. I'd like to use comma as the decimal separator but I can't get it to work. I'm very lost with all the NLS settings. I've tried using the format mask ad '9999990D00' but it still displays as dot as the decimal separator. What do I have to do in order to use comma as the decimal separator?
    Thanks

    Try putting
    SRW.DO_SQL('alter session set NLS_NUMERIC_CHARACTERS='', ''');
    in the Before Report Trigger.
    The setting might be reused for the next report if Reports is set to reuse the database connection.
    To avoid this, I guess you change it back to default in the After Report Trigger.
    Hope this helps!
    Morten

  • An alignment problem of format mask in PDF output

    Hi,
    I'm testing iAS10g on WIN2000.
    Both the Reports Developer and Reports Server versions are 9.0.4.2.
    The database character set is UTF8,
    and I'm using Adobe asian font pack in the [PDF] section of the uifont.ali config file to print Chinese characters.
    The PDF reports run well except one problem:
    The right align field attribute seems fail due to the format mask.
    The right aligned number field with format mask NNN,NNN,NN0
    overlaps with its right field when its value is greater
    than 999 (when the comma appears).
    Please help.
    Thanks.

    Excel takes it's format from the regional settings of the PC. It is a *** to get around this mandatory Excel feature. You can add a single quote in front of the value, i.e. '99-99-9999. Excel treats this as a text value.

  • Date Format Mask with text only...

    Hi!
    I have a problem with my date text item: the format mask is set to YYYY-MM-DD HH24:MI:SS and it work perfectly if the user enter only numeric character, it will validate the date correctly. But if the user enter a value only alpha (something like 'uuuuyyyy') instead of validate with the mask format it will fire an error trigger ORA-06502.
    I want to know if it's possible to check if the user has enter only alpha to bypass this problem.
    Also, how can a check that a date field is null. I Try with : IF :BLOCK_NAME.DATE_ITEM IS NULL THEN ...
    AND ALSO with IF TO_CHAR(:BLOCK_NAME.DATE_ITEM) IS NULL THEN... and nothings seems to work.
    Thanx in advance.

    AFAIK, the only way to do this is to have two items. One is a hidden database item, type DATETIME, to hold the date value.
    The other is a non-database character item, visible to the user. You populate it at POST-QUERY from the database field, and use an ON-VALIDATE-ITEM to copy any value entered/changed by the user over to the hidden field. If you're smart, you'll write a library procedure to do the on-validate stuff, passing it the names of the two items.
    In that procedure, you can attempt to convert the entered text into a valid date using whatever date format(s) you like, only raising an error if you can't do it at all.

  • Require a Number Format Mask to show leading zeros on decimals

    Hi,
    My users are complaining about the decimal point not being very clear when fractional numbers are shown. I need a format mask to show a leading zero for numbers between 0 and 1 (eg. 0.5) but not have a trailing point after whole integers.
    by example:
    10 should show "10"
    .5 should show "0.5"
    I have tried the following
    FM99990D99 which displays as
    10 as "10."
    .5 as "0.5"
    The whole integer of 10 then gets a trailing decimal point. Very ugly as the decimal is the exception to the rule which is why I need to highlight it.
    The user do not want a forced decimal place either as follows:
    FM999990D09
    10 as "10.0"
    0.5 as "0.5"
    The trailing decimal place is not a practical solution because 99% of numbers are whole numbers and the decimal just pollutes the screen with more zeros, making the numbers harder to read, resulting in more errors.
    I am looking for a format mask that shows:
    10 as "10"
    .5 as "0.5"
    I am using Oracle Forms which means I cannot set_item_instance_property for the records which have decimals. I need a single format mask for all options...
    Any help would be appreciated.
    Thanks,
    Tim.

    Thanks Francois.
    Looks like there is not a simple solution using a format mask alone.
    I have implemented a very similar solution to your suggestion. I have a character, non-base table field which I populate and dynamically set a format mask if the value is between -1 and 1 (and not zero).
    i.e.
    if :purchase.qty > -1 and
    :purchase.qty < 1 and
    :purchase.qty != 0
    then
    :purchase.qty__dsp := to_char(:purchase.qty,'FM999999990D99');
    else
    :purchase.qty__dsp := to_char(:purchase.qty);
    end if;
    Thanks,
    Tim.

Maybe you are looking for