Question format mask

Hi all

I need to convert a number '178473' to ' 000178473.00'.

I tried this, but of no use.
SELECT TO_CHAR(LPAD(178473.00,9,'0'), '999999999.00') FROM DUAL;
Required: 000178473.00

THX
Rod.

You just need to replace the 9 by 0.

SELECT TO_CHAR(178473.00 ,'FM000000000D00') FROM DUAL;

FM deletes white space on the left side. D is for the decimal separator, you respecting the NLS parameters.

Tags: Database

Similar Questions

  • Best way to apply the Format mask for the fields in a Table of the ADF

    Hi all

    12.1.3 JDev

    I would like to introduce the price data, quantity etc. fields of the ADF Table of the user interface in a specific format.

    These formats need to be dynamic, because they change according to the locale selected and sometimes they differ in the same locale.

    I tried approach converter custom but not satisfied because it is called several times when it is used in a table of the ADF and when asked that told me that this is the behavior.

    Custom converter of an attribute in a table called several times

    So, please suggest a better way to apply the format mask (which has min & max fractions, grouping, rounding) to the fields in the Table of the ADF.

    Please let me know if you need more information.

    Thank you

    B S Bilodeau.

    The second question, which I've mentioned here is the converter is called several times for each click on the table.

    This isn't a problem, this is the expected behavior (and you can't avoid it).

    Dario

  • [REQUEST] Automatically display the number with the format mask

    Hi Expert,

    I use Jdeveloper 11.1.1.6.0.

    I have a problem to display the input text that automatically uses the format mask user input, as for example the entered user 10000 then the field will automatically display of 10,000

    Is this possible to do?


    I already find but I just had to format mask that the user must input 10 000 not automatically display in format.


    Please your advice, really appreciate your help.


    Thank you

    I already find but I just had to format mask that the user must input 10 000 not automatically display in format.

    Can you describe your use case a little more?

    The format is applied only when the focus is moved out of the field.

    You want to display the groups directly separator when the user inserts the value in the field?

    In this case, you will need to use javascript, and format the entry after each character. This technique is described in the blog of Frank https://blogs.oracle.com/jdevotnharvest/entry/get_social_security_numbers_right

    Timo

  • Format mask of Crete then we enter some numbers in the text field

    Hello

    Version: Oracle Apex 5.0

    I'm trying to format mask using dynamic action. As if you enter 6 digit values in the text field, it must be auto filled with sign.i.e «-» 333 333

    Created:

    Dynamic action:

    event: key to exit

    Article: xxx

    JavaScript: $v('xxx').replace(^[[:digit:]]{3}-[[:digit:]]{3}$)

    When: touch button

    It does not any help would be great.

    Followed stops:

    Re: How to make a format for the input mask?

    Hi Pranav.shah,

    Pranav.Shah wrote:

    Version: Oracle Apex 5.0

    I'm trying to format mask using dynamic action. As if you enter 6 digit values in the text field, it must be auto filled with sign.i.e «-» 333 333

    Created:

    Dynamic action:

    event: out of key

    Article: xxx

    JavaScript: $v('xxx').replace(^[[:digit:]]{3}-[[:digit:]]{3}$)

    When: touch button

    It does not any help would be great.

    Followed stops:

    Re: How to make a format for the input mask?

    Use instead the input mask text "Text hidden v5.0" plug-in for Oracle APEX 5.0.

    Reference: Oracle Application Express Plug-Ins

    Kind regards

    Kiran

  • Download Apex 4.2 - blob in report with the Format mask

    Hello

    I need a little help.

    I have a report like this:

    SELECT id, file_name, dbms_lob.getlength (blob_content)

    of blob_docs;

    The column with the dbms_lob, is defined by the format mask, as a download link, saving up the BLOB to the user of the computer.

    My problem is a bit silly, I don't want to see 'Download', but the file name of each record, such as the 'link text'... but I can't seem to achieve this goal.

    My format mask looks like:

    DOWNLOAD: BLOB_DOCS:BLOB_CONTENT:ID:MIMETYPE:FILE_NAME:LAST_UPDATE:CHARSET:Attachment: download

    I tried to use #FILE_NAME # in the field 'Text download', since it is one of the column names, but nothing helped.

    Also used & FILE_NAME. but obviously does not work and gets the text "Download".

    All I want is a report that looks like

    File1

    File2

    File3

    Instead of

    Download file1

    Download File2

    Download file3

    Does anyone know how to get there?

    Thank you!!

    jaydarp wrote:

    I need a little help.

    I have a report like this:

    SELECT id, file_name, dbms_lob.getlength (blob_content)

    of blob_docs;

    The column with the dbms_lob, is defined by the format mask, as a download link, saving up the BLOB to the user of the computer.

    My problem is a bit silly, I don't want to see 'Download', but the file name of each record, such as the 'link text'... but I can't seem to achieve this goal.

    My format mask looks like:

    DOWNLOAD: BLOB_DOCS:BLOB_CONTENT:ID:MIMETYPE:FILE_NAME:LAST_UPDATE:CHARSET:Attachment: download

    I tried to use #FILE_NAME # in the field 'Text download', since it is one of the column names, but nothing helped.

    Also used & FILE_NAME. but obviously does not work and gets the text "Download".

    All I want is a report that looks like

    File1

    File2

    File3

    Instead of

    Download of file1

    Download File2

    File3 download

    Unfortunately (and annoying), it doesn't seem possible to do using the declarative format BLOB mask. Instead, a personalized download link should be generated in the report query using the apex_util.get_blob_file_src method of the API.

  • Format mask number in the XML editor reports

    Hi all

    I have a requirement in the format mask in xml publisher reports.

    I have a field in my report that the quantity,

    1 > if the value is 1234 I need to show as 1 234

    2 > if the value 1234.56 I need to show 1,234.56

    so I tried with properties of form with number format mask ' #, # 0.00' decimal so that's good, but for like number for 1234 also he 1,234.00 impression so I need 1 234, how I can do this, please help me.

    Thank you

    Thank you Deb to clarify. Yes just check the decimal (.) will work.

    I tried with my example of xml data, and it worked.

    Try this now...

  • 4.2 blob format mask download works not

    I use Apex 4.2

    I worked through the book beginning Oracle Application Express 4. In Chapter 6 the BLOB is added to a report.

    I pasted the code example in the report definition (though with my own page numbers):

    SELECT

    'TICKET_DETAILS '. "" TICKET_DETAILS_ID ""TICKET_DETAILS_ID"

    'TICKET_DETAILS '. "" TICKET_ID ""TICKET_ID. "

    'TICKET_DETAILS '. "" "DETAILS",

    'TICKET_DETAILS '. "" CREATED_ON ""CREATED_ON"

    'TICKET_DETAILS '. "' CREATED_BY ' 'CREATED_BY."

    DBMS_LOB. GetLength ("Attachment") SETTING

    Of

    '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 on apply I get:

    1 error has occurred

    "" not found. (Go to the error)

    I've confirmed that the query runs and P5_TICKET_ID are on page 5.

    Do not understand what it meant, I've been tracking this page

    17.10 on the BLOB Support in forms and reports

    and the section "Providing a download link" seems to confirm that the above format is correct.

    Pointers would be greatly appreciated.

    I also did the exercises in the book, and it worked for me.

    Your format mask is correct. But before pressing submit you must also enter the blob column attributes:

    Format of mask (required value): DOWNLOAD

    * Table (required value) of blob: TICKET_DETAILS

    * (Required value) column of blob: attachment

    * Primary key column 1 (required): TICKET_DETAILS_ID

    Primary key column 2:

    Mimetype column: MIME_TYPE

    Column of file name: filename

    Last update column

    Character set column:

    The content disposition: attachment

    Download text: download

    You may have forgotten who?

  • How to make the custom format mask?

    Hi all
    I work in the application using Islamic Dates (ex: 01/01/1434).
    the data stored in the following format (ex: 01011434).
    to display the data I did the method java to format then in viewRowImpl, then pass the getAttributeInternal to the method

    public static String formatHijriDate (String val)
    *{*
    Try
    *{*
    Return val.substring(6,8)+"/"+val.substring(4,6) + ' / ' + val.substring (0.4);
    *}*
    catch (Exception ex)
    *{*
    Return "";
    *}*
    *}*
    ----------
    is there a way to make the declarative custom format mask to easy my task to put in shape Hijri dates?

    I recommend you use a converter instead (http://docs.oracle.com/cd/E25178_01/web.1111/b31973/af_validate.htm#BABGIEDH). You just need to apply methods...

    Timo

  • do format mask work with either displayonly or field number

    APEX 4.0, 11g. I have a numeric field whose value 132,5 (it's a 10.2 number in the DB). I updated the Format of the element mask FML999G999G999G999G990D00 (under settings), but it is always appear as 132,5

    I changed to a displayonly type and assign to the source
    SELECT TOT_FINE_AMT
    OF CLIENT_TABLE
    WHERE XREF_NBR =: P12_XREF_NBR and the mask of format at the bottom of the Source to FML999G999G999G999G990D00 area and it is always appear 132,5

    I tried with the item number and Displayonly type and assign to the source
    Select to_number (TOT_FINE_AMT, 'FML999G999G999G999G990D00'), but in both cases, it still shows as 132,5

    of course there must be a way to make a format mask works... any ideas? (Ideally it would be a displayonly field because it is not editable, but if I can't get it to work with the type of number, it's fine too)

    Swap for to_number to_char

    Jeff

  • BLOB format masks

    All,

    I have a beast of a time trying to understand how to use blobs in a report. According to the documentation, I can select a BLOB column in a query for an interactive report and then specify a BLOB format mask, but when I do this, the column results in my report being replaced by the "No data found" message (even if I'm not change the filter options).

    My configuration:

    I have a table with report data that contains a link ID to another table with the data in the file. The report currently grabs the ID and the BLOB itself, simply because column that I am trying to understand how it works. If I do not apply a mask of the BLOB column format, it shows that "[data type not supported]. But when I specify a format mask:
    IMAGE:A103_FILES_V:FILE_DATA:FILE_ID::MIME_TYPE:FILENAME:::inline:Download
    .. Everything explodes and I get "ORA-01403: no data found. I checked the table name and the column names and that there only are data in a103_files_v to the records in the report (I even tried filtering down to a single line).

    I found Re: how to display images of the BLOB by APEX 4.0 column which talks about the use of dbms_lob.getlength (...) for the column that contains the format mask. ... This makes very little sense to me. But, still, I tried to do this, with the same result. I also tried to put the mask on the column with the ID format, but got the same behavior.

    What Miss me? Column in which the BLOB format mask lights up, and if she is not the ID, why does to the column of the file table primary key? Where to get the ID of?

    In addition, it is less useful than the sample app ducks the issue altogether by using apex_util.get_blob_file_src (...). I'm just saying.

    Thank you
    -David

    Hello
    the select statement of the EIS should look like this

    SELECT id, title DBMS_LOB. GETLENGTH (blobcol) blobcol, filename, mime_type
    FROM blobtable

    and then, when you set the format of the BLOB column (in the select statement: blobcol) report displays the download link.

    The problem is that the wizard to create the IR not looking for the TASK and change the select accordingly.

    Regards Garry

  • digital format mask

    Hi all
    I don't understand why the following query:

    Select double to_char(030.40,'09999D999')

    return

    00030,400

    that is 10 characters long, in the format mask there is 7 times the number 9, then the width must be of 7 + 1 (the sign) and not 10 fetch!

    Thank you
    Francesco
    Italy

    Hi, Francesco,.

    francy77 wrote:
    Hi all
    I don't understand why the following query:

    Select double to_char(030.40,'09999D999')

    return

    00030,400

    that is 10 characters long, in the format mask there is 7 times the number 9, then the width must be of 7 + 1 (the sign) and not 10 fetch!

    Yes, the 2nd argument of TO_CHAR has 7 ' 9 and 1 would. " It also has a '0', which causes the release of 0 to this polint. To_char leaves room for a first sign, also, makes 7 + 1 + 1 + 1 = 10.

    Use "FM" in the format string to change wheher or not, you get unnecessary spaces (including the sign and the end corresponding decimal placess to '. 99').
    It's

    TO_CHAR (30.40000, 'FM09999D99')
    

    Returns a string of 7 characters

    00030.4
    

    Do experiments with different numbers (including negative numbers), different combinations of '0' and '9' and 'FM', to understand how works the bettere TO_CHAR. (Of course, you're already readiing language SQL. Manual, so I don't need to remind you that, or to send a link, such as)
    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28286/sql_elements004.htm#sthref376
    )

    Published by: Frank Kulash, December 15, 2010 08:44
    Added a note on the FM

  • Some tips about the to_date format masks

    Hi guys,.

    I'm just after some advice here. I was responsible for a revision of the code of the work of a colleague.

    They are a .net developer who sometimes dipped in PL/SQL when necessary.

    .Net code is passing a date string in a pl/sql procedure (I don't know why, a string and not a date changed)

    the string is in the format "YYYYMMDD", but the pl/sql code is:
    select <column_names>
      from <table_nme>
     where date_column <= to_date(<parameter_date_string>,'yyyy/mm/dd')
    I tried to explain that it is not correct to have the forward slashes in the format mask, if they are not
    present in the input string, but as oracle implicitly removes slashes, the conversion to date (and therefore this code works)
    the developer is several, that it is the right path to follow.

    I am unable to prove them wrong because it works... I can't imagine a scenario where this won't work.

    How can I prove that it is a bad way to do it?

    If it's a date, it should be passed as a date. Unless he has declared the variable as a string in .net (and he had a good reason to make this kind of statement), the procedure should accept a date and .net must pass a date. Nothing good comes from having to make sure .net code generates an appropriate string to pass to the procedure the procedure can understand because finally, one of the two will be changed.

    Although the format mask works, unless there is substantial feedback that indicates what is the real format and the format mask is intentionally slightly incorrect, you create opportunities for future developers to do something stupid. If a future developer opens the procedure assumes that the specified format mask is the actual size of the string, they are likely to do things like add validation LENGTH (parameter_date_string) = 10 to make sure that all the numbers are there. They may be tempted to write a different piece of code that passes in a string that is actually in the format "yyyy/mm/dd", but omitting the 0 mm and DD (i.e. ' 2010/2/14 ') which works but now you need to ensure that all changes to the procedure supports two formats of input. 99% of the time, it's better to be strict on this that entered you agree at the start so that you don't have to worry about test each eccentric entry that might have worked at some point in the past when you have to make changes. It is much easier to ensure that a string in the format ' yyyy/mm/dd' works and everything else throws an error that in order to make a change that works for all of your applications with the exception of this one legacy application that requires an act of Congress to make changes to the and who decided to exploit your needs of optional entry to spend in another type of string (i.e. (, "yy.mm.dd") which 'works' but something rather hideous data, i.e. it seems to work very well

      1* select to_date( '09.02.14', 'yyyy/mm/dd' ) from dual
    SQL> /
    
    TO_DATE('
    ---------
    14-FEB-09
    

    but when you look throughout the year, you will discover that you are storing dates back to year 9 (2000 years ago) that really screw to the top of your reports

    SQL> alter session set nls_date_format = 'dd-mon-yyyy hh24:mi:ss';
    
    Session altered.
    
    SQL> /
    
    Session altered.
    
    SQL> select to_date( '09.02.14', 'yyyy/mm/dd' ) from dual;
    
    TO_DATE('09.02.14','
    --------------------
    14-feb-0009 00:00:00
    

    If your procedure takes an actual date or at least strictly apply the format of the string passed, you are much less likely to have users asking why data are missing, and why relationships are wrong and that you're going to invest less time in making data downstream systems angry scrubbing to get the data into a reasonable epic or to other sources of incorrect data.

    Justin

  • triggers error format mask

    Hi all

    When the format mask exceed, why forms oracle does not raise an error?
    and how can we take this error to display to the user?

    Thank you

    If the value is extracted from the database, then the value displayed in the element will be truncated.
    If the value entered by the user, then it will raise an error.

  • Form - Format mask

    Dear friends

    I use everything in preparing a bill of quantity and Uom
    I want to configure its format mask for when I'll post Uom = PCS that its format mask should be round number
    and if the unit of measure = 'kg' FORMAT mask must be with 2 decimal point.

    Sandy

    Hi, you can use the

    THEN IF: unit of measure = 'PC'
    SET_ITEM_PROPERTY ('youritem', FORMAT_MASK, 99);
    ELSIF: unit of measure = "kg".
    SET_ITEM_PROPERTY ('youritem', FORMAT_MASK, 99.99);
    ON THE OTHER
    SET_ITEM_PROPERTY ('youritem', FORMAT_MASK, 9999999);
    END IF;

  • D2k - Format mask

    Dear friends

    When creating a report, I would like to give a condition on the Format mask.

    If my unit of measure = PC then format mask must be around the figure
    If she UOM = KGS marker pole should be with 2 decimal point.

    Please suggest how to configure D2k report.

    Sandy

    Create a format trigger on your property and use SRW. SET_FORMATMASK change the formatmask, something like:

    IF :UOM='PCS' THEN
      SRW.SET_FORMAT_MASK('FM9990');
    ELSE
      SRW.SET_FORMAT_MASK('FM9990D00');
    END IF;
    

Maybe you are looking for