Format mask

i have a number variable which contains a value 15 in it. what if i want to see it like 015?

with q as (select 15 n from dual)
select to_char(n, '099') from q
TO_CHAR(N,'099')
015

Similar Messages

  • Number format mask of text item is not applied

    Hello all,
    I want to format a number like 999G999G999G999G990D00
    Is specify the format mask under source of the item. But it is not applied and I don't understand why.
    See http://apex.oracle.com/pls/otn/f?p=53873:2 for example
    Btw. is it possible to set the format for all numbers in the application at once? I want to have a thousand separator in most cases.
    Message was edited by:
    Jacob_B

    Hello Jacob,
    Btw. is it possible to set the format for all numbers
    in the application at once? I want to have a thousand
    separator in most cases.I am using substitution strings for things like that. You can define some "global" substitution strings on page application definition.
    So you just have to put in the format (999G999G999G999G990D00 ) in there once and give it a name. Let's say NUMBER_THOUSAND.
    Afterwards you can reference it wherever you need the format e.g. this way:
    to_char(10000,'&NUMBER_THOUSAND.').
    This way you just have one place where to change the format model.
    Regards,
    Tine

  • Problem with date format mask 'D'

    I am experiencing an extremely thorny problem with the date format mask ‘D’. I am trying to use it to check whether today is a Monday. The variable v_temp_day is set to sysdate. For the last 4 weeks the code has behaved erratically – giving a different result at 02:00 than at 10:30 even though it is only taking account of the date. In desperation I inserted a debug statement formatting the date in a variety of ways – with interesting results. Oracle is somehow managing to tell us that today is simultaneously Monday and Tuesday depending on which format mask you choose. Anyone got any thoughts or suggestions?
    PROC_ID TO_CHAR(STAMP_TIM
    EVENT_SQLERRM
    RRHKP010 17092007 02:00:00
    TO_NUMBER( TO_CHAR( v_temp_day, D ) ) = 2. TO_CHAR( v_temp_day, D ) = 2. TO_CHAR( v_temp_day, DY ) = MON. TO_CHAR( v_temp_day, DAY )
    = MONDAY . TO_CHAR( v_temp_day, Day DD-MON-YYYY HH24MISS ) = Monday 17-SEP-2007 020000. TO_CHAR( v_temp_day, D ) = 2.
    SQL> select to_char( sysdate, 'D' ) from dual ;
    T
    1

    My book says the trunc(d,'iw') will return "same day of the week as Jan 1st of that year"It's bad book.
    Please read about [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96540/functions176a.htm#80159]TRUNC & 'IW' Format Model and [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96529/ch3.htm#50331]Database Globalization Support Guide: First Calendar Week of the Year in the manual.

  • 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

  • Using a datepicker with format mask MM/YYYY gives error on submit

    I'm trying to use a datepicker with the format MM/YYYY.
    The item is linked to a database column of type DATE.
    The items displays correctly (month and year), but when submitting the page, I get an "ORA-01843: not a valid month" error from the built-in DML process.
    Shouldn't Apex apply the same date format mask to the item value when trying to save it to the database?
    - Morten
    http://ora-00001.blogspot.com

    Hi Mike,
    I can/need to do that for my own PL/SQL processes, but the problem is with the Built-In DML Process....
    - Morten
    http://ora-00001.blogspot.com

  • Date format mask in Enter-Query mode

    Hi,
    I'm developing a Form which is able to query the masterblock from a detail-item.
    The queryable detail-item is a date field and has a datatype: DATETIME. When a new record is entered the values in the date field are stored in the database like "18-10-2002 15:04:02"
    When the form is in enter_query mode the user must be able to enter 18-10-2002 (DD-MM-YYYY format mask, so without time mask). When execute the query with this date format the query is not able to find data.
    I used a Key-Execute-Query on the detailblock like this:
    SELECT 1.COLUMN
    , 2.COLUMN
    INTO :1.COLUMN
    , :2.COLUMN
    FROM TABLE.1
    , TABLE.2
    WHERE 1.COLUMN = 2.COLUMN
    AND TO_CHAR(1.COLUMN,'dd-mm-yyyy') = to_date(:avg.datum,'dd-mm-yyyy');
    Can anyone please help me?
    Regards,
    Ronny.

    Hi Ronny,
    I'm not sure to have got exactly your issue (especially why you have to use that select in master-detail query), but I suggest you to substitute
    ...AND TO_CHAR(1.COLUMN,'dd-mm-yyyy') = to_date(:avg.datum,'dd-mm-yyyy');
    with
    ...TRUNC(1.COLUMN) = TO_DATE(:avg.datum,'dd-mm-yyyy');
    To be fair, I would use it in the where clause, even if you set it dinamically.
    Let us know,
    Marco

  • 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 <c:out value="${bindings.MyDate}"></c:out> the format mask for the date is applied and it looks good, but when using
    <c:forEach var="Row" items="...">
    <c:out value="${Row.MyDate}"></c:out>
    </c:forEach>
    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 <html:form> ? Since it works using <c:out value="${bindings.MyDate}"></c:out> inside a html:form.

  • Error when using format mask to create download link in report

    I'm following these directions to create a download link in a report region.
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/advnc_blob.htm#HTMDB25905
    ######### Table Structure...
    desc document_library
    Name Null Type
    DOC_ID NOT NULL VARCHAR2(40)
    DATE_ADDED NOT NULL DATE
    FILE_CONTENT BLOB()
    FILE_NAME VARCHAR2(100)
    MIME_TYPE VARCHAR2(100)
    DOC_NUMBER NUMBER
    ###### Report Region...
    select a.*, dbms_lob.getlength(file_content) length
    from document_library a
    ###### Download Link Column...
    Date Format: DOWNLOAD:DOCUMENT_LIBRARY:FILE_CONTENT:DOC_NUMBER::MIME_TYPE:FILE_NAME:::attachment:Download
    ####### Results...
    report error:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    The report region displays no rows (even though there is one row in the table), no links, and even more strange, it show the value of APP_USER where it would normally display the results.

    Josh,
    Your end result on page 58 and the instructions in that document link don't seem to correlate. Regardless, I:
    1) Copied page 58 to page 158 in your application.
    2) Removed the BLOB format mask from your report link.
    3) Changed your query to:
    select "ROWID",
    "DOC_ID",
    "DATE_ADDED",
    "USER_ID",
    dbms_lob.getlength("FILE_CONTENT") "FILE_CONTENT",
    "FILE_NAME",
    "MIME_TYPE",
    "DOC_NUMBER"
    from "#OWNER#"."DOCUMENT_LIBRARY"
    4) Specified the BLOB format mask for the FILE_CONTENT column.
    Seems to work just fine now (on page 158, that is).
    Joel

  • How do you add a format to the "Date Picker Format Mask" available formats?

    Hi,
    When I select the Date Picker Format Mask or "Number / Date Format" they doen't have YYYYMMDD or others that may be desired...
    How do you add a format to the available formats?
    Thank you, Bill

    Bill - From the popup help text:
    If you need to create a Date Picker item, but the format you need does not appear in the Display As list, select Date Picker (use application format mask). When an application uses this type of date picker, the Application Express engine derives the date format from an item named PICK_DATE_FORMAT_MASK. You can populate this item in two ways:
    - By defining an application substitution string named PICK_DATE_FORMAT_MASK
    - By creating an application-level item named PICK_DATE_FORMAT_MASK
    See the doc for more details.
    Scott

  • Error in SQL Date Format Mask

    Hi,
    I am facing problem in validation data in FDQM.
    When I am trying to validate data,I am getting an error as ' An Error occured.Please verify that SQL Date Format Mask is correct'
    The current Date Format in our application is YYYYMMDD.
    I did not have this problem earlier in validating data.This problem is occuring now only and also this error is coming for few entities only.
    Could any one suggest me on how this can be resolved.
    Thanks

    Hi Kelly,
    I checked periods in control tables and there are no duplicates.
    The Period Date Format Mask is MMM-YYYY where as the SQL Date Format Mask is YYYYMMDD.
    These settings are there since the time I created application.Has it got anything to do with database.
    Appreciate your quick response
    Regards,
    Mrudula

  • In chart component value format mask

    Hi, I wrote chart component. In display options page I want to set value format mask. I want to show the value||%(percent symbol) for example 40% . I set value format mask 999.99% but it doesn't show. How can I do this. thanks.

    I calculated percentage but I want to show axis value with % symbol. For example
    Nevzat -------------------- 40%
    Ali -------------- 20%
    Hasan -------------------------- 60%

  • Presentation Variable Optional Format Mask

    Hi,
    On page 45 of the Answers documentation at
    http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/b31767.pdf
    It says that you can specify an optional format mask for a presentation variable:
    ##Start Of Extract##
    @{variables.<variableName>}{<value>}\[format] - for presentation variables
    For example, @{variables.myFavoriteRegion}{Central} - inserts the value of the
    presentation variable myFavoriteRegion.
    ❏ variables - prefix that is required when you reference a presentation variable in a request.
    ❏ variableName - a reference to an object available in the current evaluation context. For example: @{variables.myFavoriteRegion}.
    ❏ value - (optional) - a constant or variable reference indicating a value to be used if the variable referenced by the variableName isn't populated (is undefined).
    ❏ format - (optional) - a format mask dependent on the data type of the variable. For example: #,##0, MM/DD/YY hh:mm:ss, and so on.
    ##End Of Extract##
    Has anyone got this optional format mask to work? I've tried things like:
    @{pv_my_date}{01/01/2009}\[YYYY-MM-DD]
    hoping that it would render the 01/01/2009 into 2009-01-01 format but to no avail. Annoyingly there are no examples of a format mask being used, and I can't see any examples in Paint or Sales either, so maybe the documentation is wrong.
    But wouldn't it be great if it did work - render dates into exactly the format you want, regardless of what locale the user is using!

    Try to look into that prompt column to see why you are getting different date format.
    If it is not correct as per you application then I would suggest to correct it using column->Data Format and then Save.
    I would suggest to convert the filter to SQL format to handle it, you may get it after Filter... button add date and then use Advanced button. using SQL you have options to do it.
    Thanks
    Edited by: Srini VEERAVALLI on Apr 12, 2013 7:47 AM
    What is Print Date?!! Is that available column in Subject Area? If you dont know why its like that investigate.
    Edited by: Srini VEERAVALLI on Apr 12, 2013 8:10 AM

  • 4.2 blob download format mask not working

    I am using Apex 4.2
    I have been working through the book Beginning Oracle Application Express 4. In chapter 6 the a blob is added to a report.
    I have pasted the code example into the report definition (albeit with my own page numbers) :
    SELECT
       "TICKET_DETAILS"."TICKET_DETAILS_ID" "TICKET_DETAILS_ID",
       "TICKET_DETAILS"."TICKET_ID" "TICKET_ID",
       "TICKET_DETAILS"."DETAILS" "DETAILS",
       "TICKET_DETAILS"."CREATED_ON" "CREATED_ON",
       "TICKET_DETAILS"."CREATED_BY" "CREATED_BY",
       dbms_lob.getlength("ATTACHMENT") ATTACHMENT
    FROM
       "TICKET_DETAILS"
    WHERE (("TICKET_DETAILS"."TICKET_ID" = :P5_TICKET_ID))
    I go to the report attributes and click on the attachment column.  I enter the suggested format mask
    DOWNLOAD:TICKET_DETAILS:ATTACHMENT:TICKET_DETAILS_ID::MIME_TYPE:FILE_NAME:::inline:Download.
    When I press apply I keep getting :
    1 error has occurred
    "" not found. (Go to error)
    I have confirmed that the query runs and that P5_TICKET_ID does exist on page 5.
    Not understanding what this meant I tracked down this page
    17.10 About BLOB Support in Forms and Reports
    and the section "Providing a Download Link" seems to confirm that the above format mask is correct.
    Any pointers would be greatly appreciated.

    I've also done the exercises in the book and it worked for me.
    Your format mask is correct. But before pressing submit you also have to enter the blob column attributes:
    *Format Mask (Value Required):                   DOWNLOAD
    *Blob Table (Value Required):                       TICKET_DETAILS
    *Blob Column (Value Required):                   ATTACHMENT
    *Primary Key Column 1 (Value Required):     TICKET_DETAILS_ID
    Primary Key Column 2:
    Mimetype Column:                                      MIME_TYPE
    Filename Column:                                       FILE_NAME
    Last Updated Column
    Character Set Column:
    Content Disposition:                                    ATTACHMENT
    Download Text:                                           Download
    Maybe you forgot that?

  • Problem with format mask and currency

    Hi,
    I am trying to apply a format mask to a report column.
    I want my format to be: 4500 ==> $4,500.00
    I have tried to apply: FML999G999G999G999G990D00, and i get #4,500.00
    Do i have to set a currency parameter somewhere for this format mask to work?
    I have done a select * from nls_database_parameters:
    NLS_LANGUAGE AMERICAN
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET US7ASCII
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    Thanks in advance,
    Immanuel

    Immanuel,
    Here's what I believe is going on:
    1) Your database character set is US7ASCII. US7ASCII cannot store a '£' character.
    2) Although the real NLS_CURRENCY symbol for NLS_TERRITORY UNITED KINGDOM is '£', it's displaying a converted character of '#', due to the above reason.
    3) The currency symbol from the format mask is determined by your NLS_TERRITORY (and hence, your NLS_CURRENCY) settings for the session.
    4) Your application is most likely setup to run with an application primary language of English United Kingdom. Thus, your application will always set NLS_TERRITORY to UNITED KINGDOM.
    To get your desired result, either:
    1) Change your application primary language to en-us
    or simpler yet
    2) Hard-code the $ sign in your format mask.
    Joel

  • Referencing report columns in the BLOB download link format mask

    Hi there,
    In a basic report (Apex 4) I have a link to download a BLOB stored in the table. However to save space, instead of using 2 columns, one for the file name and one for the download link, I want to use only one column where the file name is the download link itself.
    To do this, I tried using this download link format mask (ATTACH_FILENAME is the report column that contains the file name):
    DOWNLOAD:ATTACHMENTS:ATTACH_BLOB:ATTACHMENT_ID::ATTACH_MIME_TYPE:ATTACH_FILENAME:::attachment:#ATTACH_FILENAME#
    However it shows #ATTACH_FILENAME# in all rows instead of the actual file name!
    I know that using substitution strings (&) works, so is there a way to also reference report columns in this format mask?
    Thanks
    Luis

    Luis, did you finally resolve this? I have the same question.

  • 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.

Maybe you are looking for

  • S/PDIF out produces static when playing audio, sometimes with video

    This is my first install of Arch Linux, and I am a bit of a noob. I started using Arch because I wanted to learn, and it's been absolutely perfect--I actually love it so far, and this is the first major problem I've had. Most of the Arch documentatio

  • Unknown error (-124) HELP!!!!!!!!!!!!!!!!

    I'd had some troubles with my ipod software so I downloaded itunes again and the ipod worked perfectly, then midways it stopped and said "unknown error (-124)" and now, the computer won't recognize it. It's a 4G black ipod... I don't know if it makes

  • Things we all want in the MacMini!!!

    Howdy everyone, I am very excited about the new MacIntel Mini! Some great enhancements Apple made was the addition of two extra USB 2.0 ports! Yea! They also added Front Row and the Apple IR Remote too! However, when they did this, lets go all the wa

  • Table maintenance generator with radiobuttons

    Hello, how can I automatically (via se11: table maintenance generator) generate from a DDIC-structure the radiobtton-fields on a dynpro? If I use the domaine 'X' or 'XFELD', I only get checkboxes.... kind regards

  • My macbook pro 10.6.8 won't install the software update.

    It says to restart and it will start installing but when i click restart it just sits at my desktop screen and doesn't do anything. i've also tried downloading it from the Apple site but it doesn't work either! someone help !!