Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Overriding the data format set at the APEX

SwaminathanJul 20 2019 — edited Jul 23 2019

Dear all,

Am facing an issue with the date format in APEX. The date format set at the application level is different from the one in the item level.

Kindly suggest me to override the application level date format with the one at the item level.

Application Date Format => DD-MON-YYYY HH:MIPM

Item level format mask => DD-MON-RR

Item level validation

IF

( :P2_MANUFACTURE_DATE IS NOT NULL

AND PARSE_DATE(:P2_MANUFACTURE_DATE, 'DD-MON-RR') = 'N'

)

THEN

  RETURN FALSE;

ELSE

  RETURN TRUE;

END IF;

PARSE_DATE database function:

create or replace

FUNCTION PARSE_DATE(INDATEVALUE IN VARCHAR2, INDATEFORMAT IN VARCHAR2)

RETURN VARCHAR2

IS

  V_RESULT VARCHAR2(1);

  V_DATE    DATE;

  V_DATEFORMAT VARCHAR(12);

  BEGIN

  BEGIN

    V_DATEFORMAT := 'fx' || INDATEFORMAT;

    V_DATE  := TO_DATE(INDATEVALUE,V_DATEFORMAT);

    V_RESULT := 'Y';

   

  EXCEPTION

   WHEN OTHERS

      THEN V_RESULT := 'N';

  END;

  RETURN V_RESULT;

END;

Error:

ORA-01830: date format picture ends before converting entire input string

Error ERR-1021 Unable to run "function body returning boolean" validation.

Thanks.

Swaminathan

Comments
Post Details
Added on Jul 20 2019
5 comments
1,191 views