A script-enabled browser is required for this page to function properly.

Format Mask Property

Description

Specifies the display format and input accepted for data in text items.

Applies to text item

Set Oracle Forms, programmatically

Refer to Built-in

GET_ITEM_PROPERTY

SET_ITEM_PROPERTY

Required/Optional optional

Usage Notes

Valid format masks for character strings, numbers and dates are described in the following tables.

Character Strings

The following table describes valid format masks for character strings.

Element

Example

Description

FM

FMXX99

Fill mode: accept string as typed, do not right justify. Allows end user input string to be shorter than the format mask.

X

XXXX

Any alphabetic, numeric, or special character. End user input string must be exact length specified by format mask.

9

9999

Numeric characters only. End user input string must be exact length specified by format mask.

A

AAAA

Alphabetic characters only. End user input string must be exact length specified by format mask.

Character String Examples

Format Mask

Description

XXAA

Will accept: --ab, abcd, 11ab; will not accept: --11, ab11, or ab--(must use XX to accept hyphens and other special characters).

XXXX

Will accept any combination of alphabetic, numeric, or special characters: --ab, abcd, 11ab, --11, ab11, or ab--. Will accept 1234 or abcd; will not accept 123 or abc. (To accept input string shorter than mask, use FMXXXX.)

FMXX99

Will accept ab12, ab1, ab followed by two spaces; will not accept 12ab or abcd. (To produce the Oracle Forms Version 3.0 Alpha datatype, use FMAAAAAA.)

NUMBERS

The following table describes valid format masks for numbers.

Element

Example

Description

9

9999

Number of nines determines display width. Any leading zeros will be displayed as blanks.

0

0999

Display leading zeros.

0

9990

Display zero value as zero, not blank.

$

$9999

Prefix value with dollar sign.

B

B9999

Display zero value as blank, not "0".

MI

9999MI

Display "-" after a negative value.

PR

9999PR

Display a negative value in <angle brackets>.

comma

9,999

Display a comma in this position. For correct behavior in multilingual applications, substitute G to return the appropriate group (thousands) separator.

period

99.99

Display a decimal point in this position. For correct behavior in multilingual applications, substitute D to return the appropriate decimal separator.

E

9.999EEEE

Display in scientific notation (format must contain exactly four "E"s).

FM

FM999 

Fill mode: accept string as typed, do not right justify.

NUMBER Examples

Format Mask

Description

FM099"-"99"-"9999

Displays the social security number as formatted, including hyphens, even if end user enters only nine digits.To create a Social Security column, create an 11-character column, set to fixed length, with a format mask of 099"-"99"-"9999. This mask will accommodate Social Security numbers that begin with zero, accepting 012-34-5678 or 012345678 (both stored as 012345678).

99999PR

Accepts -123; reformats as <123>.

999MI

Accepts -678; reformats as 678-.

9.999EEEE

Displays as 1.00E+20.

How Forms handles length mismatches

If a runtime user enters a numeric string that exceeds the format mask specification, the value will be rejected. For example:

Format Mask

User enters

Result

99.9

321.0

Invalid

99.9

21.01

Invalid

99.9

21.1

21.1

99.9

01.1

1.1

In contrast, if a numeric value fetched from the database exceeds the format mask specification for its display field, the value is displayed, but truncated, with rounding, to fit the mask. (The item itself within the Forms application retains its full value.) For example, if the database held the value 2.0666, and the format mask was 99.9, the value displayed to the user would be 2.1. However, the value of the item within the form would be the full 2.0666.

Dates

The following table describes valid format masks for dates.

Element

Description

YYYY or SYYYY

4-digit year; "S" prefixes "BC" date with "-".

YYY or YY or Y

Last 3, 2, or 1 digits of year.

Y,YYY

Year with comma in this position.

BC or AD

BC/AD indicator.

B.C. or A.D.

BC/AD indicator with periods.

RR

Defaults to correct century. Deduces the century from a date entered by comparing the 2 digit year entered with the year and century to which the computer's internal clock is set. Years 00-49 will be given the 21st century (the year 2000), and years from 50-99 will be given the 20th century (the year 1900).

MM

Month (01-12; JAN = 01).

MONTH

Name of month, padded with blanks to length of 9 characters.

MON

Name of month, 3-letter abbreviation.

DDD

Day of year (1-366).

DD

Day of month (1-31).

D

Day of week (1-7; Sunday=1).

DAY

Name of day, padded with blanks to length of 9 characters.

DY

Name of day, 3-letter abbreviation.

J

Julian day; the number of days since January 1, 4712 BC.

AM or PM

Meridian indicator.

A.M. or P.M.

Meridian indicator with periods.

HH or HH12

Hour of day (1-12).

HH24

Hour of day (0-23).

MI

Minute (0-59).

SS

Second (0-59).

SSSSS

Seconds past midnight (0-86399).

/. , .

Punctuation is reproduced in the result.

"..."

Quoted string is reproduced in the result.

FM

Fill mode: assumes implied characters such as O or space; displays significant characters left justified. Allows end user input to be shorter than the format mask. (Use in conjunction with FX to require specific delimiters.)

FX

All date literals must match the format mask exactly, including delimiters.

Date Examples

Format Mask

Description

FXDD-MON-YY

Will accept 12-JAN-94, but will not accept 12.JAN.94 or 12/JAN/94 because the delimiters do not match the mask. Will not accept 12JAN94 because there are no delimiters. Will accept 01-JAN-94 but will not accept 1-JAN-94.

FMDD-MON-YY

Will accept 01-JAN-94. Will also accept the entry of other delimiters, for example 01/JAN/94 and 01 JAN 94. However, will not accept 01JAN94. Will accept 1-JAN-94, converting it to 01-JAN-94.

DD-MON-YY

Will accept 12.JAN.94, 12/JAN/94 or 12-JAN-94. Note: Any delimiter characters will be accepted, but if delimiters are omitted by the end user, this mask will interpret date characters as a delimiters. Will accept 12-JAN94, (but will erroneously interpret as 12-JAN-04); but will not accept 12JAN94, because "AN" is not a valid month name.

Format Mask

Description

FMMONTH" "DD", "YYYY

Displays the text item data in the specified date format: JANUARY 12, 1994, including the appropriate blank spaces and comma.

FMDD-MONTH-YYYY

Displays as 12-JANUARY-1994.

DY-DDD-YYYY

Displays as WED-012-1994. Note: for input validation including day of the week, a mask that allows specific determination of the day is required, such as this example or DY-DD-MM-YY.

Format Mask

Description

DD-MONTH-YYYY

Displays as 12-JANUARY-1994.

DY-DDD-YYYY

Displays as WED-012-1994.

DY-DD-MON-YY

Displays as WED-12-JAN-94. Be sure to include month. Avoid masks such as DY-DD-YY, which could generate an error.

NLS Format Masks

The following table describes valid National Language Support (NLS) format masks.

Element

Example

Description

C

C999

Returns the international currency symbol.

L

L9999

Returns the local currency symbol.

D

99D99

Returns the decimal separator.

G

9G999

Returns the group (thousands) separator.

comma

9,999

Displays a comma in this position.

period

9.999

Displays a decimal point in this position. Displays a decimal point in this position.

NLS Format Mask Examples

Format Mask

Description

L99G999D99

Displays the local currency symbol, group, and decimal separators: if NLS_LANG=American, this item displays as $1,600.00; if NLS_LANG=Norwegian, this item displays as Kr.1.600,00.

C99G999D99

Displays the appropriate international currency symbol: if NLS_LANG=American, this item displays as USD1,600.00; if NLS_LANG=French, this item displays as FRF1.600,00.

Format Mask Restrictions


Data Type Property