Handling Date Format

Hi Everyone,
I am using DB 11g and Apex 4.1 Versions.
We are working on a project where most of the time we would be uploading CSV through Apex and store the data in DB using some procedures developed by us and most of the time we get different date formats in the CSV which is sent by the client. It is the major issue which i encounter in my carrer.
Please suggest me how we can handle or tell the procedure to check if one format doesn't work take another if that also doesn't work go for another.
Any link or code or anything Please help me with this and make my career a bit more easy :)
Thanks,
Shoaib

Hi, Shoaib,
Shoaib581 wrote:
Thanks Guys,Pay particular attention to Paul's reply. The people who enter the data are the best people to make sure it is correct. Do whatever you can to ensure valid, consistent data entry. It may be hard for users who want to use their own favorite format, but not as hard as it is to correct mistakes later.
>
>
Your clarification really helped me and made many things clear for me :). Any suggestion, how we can handle if the date format comes in below formats,
DD-MM-YY OR DD-MON-YY formats. Oracle forgives you if you use 'MON' where 'MM' was expected, so
TO_DATE ( '1-Dec-2012'
        , 'DD-MM-YYYY'
        )returns Decemer 1, 2012: it WILL NOT raise an error.
The converse is not true: TO_DATE (str, 'DD-Mon-YYYY') WILL raise an error if you the month part is '12'.
Here's a package function I wrote to try various formats in turn:
--          **   t o _ d t   **
--     to_dt attempts to convert in_txt to a DATE using in_fmt_1_txt.
--     If that fails, it tries again, using in_fmt_2_txt.
--     If that fails, it tries again, using in_fmt_3_txt, and so on.
--     As soon as one conversion works, the function returns the DATE,
--     and the remaining formats are not tried.
--     If all the formats given fail, then in_default_dt is returned.
FUNCTION     to_dt
(     in_txt          IN     VARCHAR2                    -- string to be converted
,     in_fmt_1_txt     IN     VARCHAR2     DEFAULT     'DD-Mon-YYYY'     -- 1st format to try
,     in_fmt_2_txt     IN     VARCHAR2     DEFAULT NULL          -- 2nd format to try
,     in_fmt_3_txt     IN     VARCHAR2     DEFAULT NULL          -- 3rd format to try
,     in_fmt_4_txt     IN     VARCHAR2     DEFAULT NULL          -- 4th format to try
,     in_fmt_5_txt     IN     VARCHAR2     DEFAULT NULL          -- 5th format to try
,     in_default_dt     IN     DATE          DEFAULT     NULL          -- Returned if nothing works
RETURN     DATE
DETERMINISTIC
IS
     fmt_cnt          PLS_INTEGER     := 5;          -- Number of in_fmt_ arguments
     fmt_num          PLS_INTEGER     := 1;          -- Number of argument being tried
     return_dt     DATE           := NULL;     -- To be returned
BEGIN
     FOR  fmt_num  IN  1 ..  fmt_cnt
     LOOP
          BEGIN     -- Block to trap conversion errors
               return_dt := TO_DATE ( in_txt
                                   , CASE     fmt_num
                                          WHEN  1     THEN  in_fmt_1_txt
                                          WHEN  2     THEN  in_fmt_2_txt
                                          WHEN  3     THEN  in_fmt_3_txt
                                          WHEN  4     THEN  in_fmt_4_txt
                                          WHEN  5     THEN  in_fmt_5_txt
                                END
               -- If control reaches this point, then TO_DATE worked
               RETURN     return_dt;
          EXCEPTION
               WHEN OTHERS
               THEN
                    IF  SQLCODE  BETWEEN -1865
                                  AND     -1839
                    THEN
                            NULL;
                    ELSE
                         RAISE;
                   END IF;
          END;     -- Block to trap conversion errors
     END LOOP;
     RETURN     in_default_dt;
END     to_dt
;Once again, this will convert a string like '12/11/10' to a DATE. It will not necessarily return the same DATE that was meant by whoever entered the string.

Similar Messages

  • Handle Date format in a dynamic way

    Hi Experts,
    I need to handle the date format in a dynamic way in different systems.
    Sample Scenario:
    In my DEV system i am writing a select query where i need to validate the date field which is of the format 12/31/9999.
    select * from <table> where date = '12/31/9999'.
    This gets relevant records & works fine in DEV system.
    But when it goes to QA system the same select query fails to fetch data as the date format is 12.31.9999.
    select * from <table>
    where date = '12/31/9999'. --> Fails
    Similarly when it is PRD system (production) the same select query fails as the date format is 12-31-9999.
    select * from <table>
    where date = '12/31/9999'. --> Fails
    Please post your suggestions.
    Thanks
    Dany

    If you are looking at the date from SE16, or some other output screen, dates are converted to what is referred to as external format. But when they are stored, they are stored in internal format which is always YYYYMMDD. So when you are doing a SELECT from database table using a date field in your WHERE clause, you have to use internal format of the date (YYYYMMDD). When you output a date that you extracted onto a screen using WRITE statement, it will be converted to external format depending on user format specifications. But the date will be in internal format within your program, so if you are transferring a date from the database directly to a file, you are transferring it as YYYYMMDD. If you need it in external format, then you have to use WRITE...TO... option. See help on WRITE command.

  • Streams Conflict Handler Date Format

    Hi.
    Into my Conflict Handler PL/SQL I have this instruction:
         tmp := lcr.get_value('NEW','DT_ULT_VERIFICACAO'); rc := tmp.getDATE(v_DT_ULT_VERIFICACAO);
         IF (v_DT_ULT_VERIFICACAO is not null) THEN
         cmdupd := cmdupd||',DT_ULT_VERIFICACAO='||'TO_DATE('''||v_DT_ULT_VERIFICACAO||''','''||'DD/MM/RR'||''')'; END IF;
    The result after execution is:
    UPDATE HW_ITENS SET USER_UNF_ID=13,CD_ITEM=4,NR_INMETRO=32037347,NR_SERIE='ME - 0295',
    DT_ULT_VERIFICACAO=TO_DATE('04-DEC-09','DD/MM/RR'),NR_ULT_VERIFICACAO=21036627,TP_ULT_RESULTADO=4
    WHERE ITM_ID = 2836955 and SRV_UNF_ID = 13
    As we can see, I received a date format of DD/MON/AA. This is not good to my work. I need a date format of DD/MM/AA.
    How can I change this when using a Apply Conflict Handler ?
    Thank in advance.
    JoseFormiga

    Did you checked the setting of the database NLS_DATA_FORMAT if the column was date or NLS_TIMESTAMP_FORMAT for timestamp.
    Check the setting of V$NLS_PARAMETERS.
    set pages 66 lines 190
    SQL> select * from V$NLS_PARAMETERS
    PARAMETER                                                        VALUE
    NLS_LANGUAGE                                                     AMERICAN
    NLS_TERRITORY                                                    AMERICA
    NLS_CURRENCY                                                     $
    NLS_ISO_CURRENCY                                                 AMERICA
    NLS_NUMERIC_CHARACTERS                                           .,
    NLS_CALENDAR                                                     GREGORIAN
    NLS_DATE_FORMAT                                                  DD-MON-RR
    NLS_DATE_LANGUAGE                                                AMERICAN
    NLS_CHARACTERSET                                                 AL32UTF8
    NLS_SORT                                                         BINARY
    NLS_TIME_FORMAT                                                  HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT                                             DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT                                               HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT                                          DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY                                                $
    NLS_NCHAR_CHARACTERSET                                           AL16UTF16
    NLS_COMP                                                         BINARY
    NLS_LENGTH_SEMANTICS                                             CHAR
    NLS_NCHAR_CONV_EXCP                                              FALSE

  • Problem in Date Format when user chages the date format in preferences

    I want to generalize my code so that user can change what ever Date format he wants, I will get the date from the page in the format yyyy-mm-dd, and if the Date Format is
    set to MM/dd/yyyy in prefernces i need to use MM/dd/yyyy and if the Date Format is set to dd-Mon-yyyy in prefernces i need to use dd-MMM-yy, so my question is how to know what Date format is set in the preference so that i can have all the possible date format for inserting the date
    Thanks
    Babu

    Babu,
    The date format in OAF Pages is controlled by profile ICX: Date format mask.This profile can be set at site as well as user level for the individual users to set the Date format.
    But I would advice not to go for setting different profile values at user level, because i remember some old threads, where seeded Oracle pages fail, as code their is not generalised to handle date formats.
    If your are planning to have this in ur custom page, go ahead, but do check the entire flow is working fine for different values of this profile at user level.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Date Format IN BDC

    Hi,
    In One Interview I was asked that How can You Handle Data Format when Writing BDC ?

    Satya,
    The date format depends on User settings. Its different for different login ID's.
    It can be YYYY.MM.DD or MM.DD.YYYY or anything.
    To handle the date format, you need to query on table USR01 and fetch DATFM field that stores date format.
    Refer below piece of code
    */...Fetch the date format settings for the user
          SELECT SINGLE datfm
                   INTO gv_date_format
                   FROM usr01
                  WHERE bname = sy-uname.
      CASE gv_date_format.
        WHEN 1.     "DD.MM.YYYY
          CONCATENATE fv_impdate+6(2) '.'
                      fv_impdate+4(2) '.'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 2.     "MM/DD/YYYY
          CONCATENATE fv_impdate+4(2) '/'
                      fv_impdate+6(2) '/'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 3.     "MM-DD-YYYY
          CONCATENATE fv_impdate+4(2) '-'
                      fv_impdate+6(2) '-'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 4.     "YYYY.MM.DD
          CONCATENATE fv_impdate+0(4) '.'
                      fv_impdate+4(2) '.'
                      fv_impdate+6(2) INTO fv_expdate.
        WHEN 5.     "YYYY/MM/DD
          CONCATENATE fv_impdate+0(4) '/'
                      fv_impdate+4(2) '/'
                      fv_impdate+6(2) INTO fv_expdate.
        WHEN 6.     "YYYY-MM-DD
          CONCATENATE fv_impdate+0(4) '-'
                      fv_impdate+4(2) '-'
                      fv_impdate+6(2) INTO fv_expdate.
      ENDCASE.
    This would convert the date into the format set for user.
    Hope this is helpful.
    Amogh

  • Numbers App - .xls Imported Date Format

    Hi,
    I've just installed Numbers on IOS 7 (IPAD2) and have imported an .xls 97 file. All is good except the dates which have been imported as serial numbers e.g. 1/12/2013 appears as 41609. I have tried formatting the cells as date with any of the variations of the "5 Jan etc" example yet the number remains. The only way I can correct them is to re-enter them manually. The regional (UK) settings for the Ipad are correct so I'm not sure what's causing this, or what it is I've missed - any advice greatly appreciated. Thank you.

    No expereince with LibreOffice, so I can't address how it handles date formating. Its sounds a little like it is still including the time sets and storing them using using a string that Numbers can't convert (and Excel does recognize), but I'm just guessing.
    This might provide a clue: https://help.libreoffice.org/Calc/Date_and_Time_Functions. or at least a starting point for your research.

  • "could not be handled because Pages cannot open files in the "data" format."

    I cannot open some files from at least two different friends.   the message that I get is "could not be handled because Pages cannot open files in the “data” format.”. 
    I have OSX 10.9.2
    I have the latest version of Pages 5.2
    Any help is appreciated. I'd like to be able to open files. Thank you.

    Could your friend possibly be using a Mac running OS 9?
    Or one of the early versions of OSX?
    They are the only Systems I know of that don't have file extensions on the files, because they used data forks in the file, something Apple eventually abandoned, in the interests of compatiblity with Windows and UNIX generally.
    I had a look AmigaOS also had a form of file and resource separation, in which the main file does not have an extension.
    Peter

  • How to handle Multiple date formats for the same date field in SQL*Loader

    Dear All,
    I got a requirement where I need to get data from a text file and insert the same into oracle table.
    I am using SQL*Loader to populate the data from the text file into my table.
    The file has one field where I am expecting date date data in multiple formats, like dd/mon/yyyy, yyyy/dd/mon, yyyy/mon/dd, ,mm/dd/yyyy, mon/dd/yyyy.
    While using SQL*Loader, I can see Loading is failing for records where we have formats like yyyy/dd/mon, yyyy/mon/dd, mon/dd/yyyy.
    Is there any way in SQL*Loader where we can mention all these date formats so that this date data should go smoothly into the underlying date column in the table.
    Appreciate your response on this.
    Thanks,
    Madhu K.

    The point being made was, are you sure that you can uniquely identify a date format from the value you receieve? Are you sure that the data stored is only of a particular limited set of formats?
    e.g. if you had a value of '07/08/03' how do you know what format that is?
    It could be...
    7th August 2003 (thus assuming it's DD/MM/RR format)
    or
    8th July 2003 (thus assuming it's MM/DD/RR format)
    or
    3rd August 2007 (thus assuming it's RR/MM/DD format)
    or
    8th March 2007 (thus assuming it's RR/DD/MM format)
    or even more obscurely...
    3rd July 2008 (MM/RR/DD)
    or
    7th March 2008 (DD/RR/MM)
    Do you have any information to tell you what formats are valid that would allow you to be specific and know what date format is meant?
    This is a classic example of why dates should be stored on the database using DATE datatype and not VARCHAR2. It can lead to corruption of data, especially if the date can be entered in any format a user wishes.

  • Fm that handle data conversion with respective format

    HI ,
    there is FM that retrive the date like the format that was the input
    like
         01.01.2006
         01012006
    i found the CONVERT_DATE_TO_INTERNAL Fm and other ...
    but it return the date in the format 20060101
    Regards
    Alex
    Moderator message: date formatting questions = FAQ, please search before posting.
    Edited by: Thomas Zloch on Dec 7, 2010 5:07 PM

    check out FM CONVERT_DATE_FORMAT.

  • Problem with date format dd/mm/yyyy. But I need to convert yyyy-mm-dd.

    Dear friends,
    I have the problem with date format. I receiving the date with the format dd/mm/yyyy. But I can upload to MySQL only in the format of yyyy-mm-dd.
    how should I handle this situation, for this I've created these code lines.But I have some problem with these line. please help me to solve this problem.
    String pattern = "yyyy-mm-dd";
    SimpleDateFormat format = new SimpleDateFormat(pattern);
    try {
    Date date = format.parse("2006-02-12");
    System.out.println(date);
    } catch (ParseException e) {
    e.printStackTrace();
    System.out.println(format.format(new Date()));
    this out put gives me Tue Apr 03 00:00:00 IST 2007
    But I need the date format in yyyy-mm-dd.
    regards,
    maza
    thanks in advance.

    Thanks Dear BalusC,
    I tried with this,
    rs.getString("DATA_SCAD1")// where the source from .xls files
    String pattern = "yyyy-MM-dd";
    SimpleDateFormat format = new SimpleDateFormat(pattern);
    try {
    Date date = format.parse("DATA_SCAD1");
    System.out.println(date);
    } catch (ParseException e) {
    e.printStackTrace();
    System.out.println(format.format(new Date()));
    this out put gives me Tue Apr 03 00:00:00 IST 2007
    But I want to display the date format in yyyy-mm-dd.
    regards,
    maza

  • OAF changes Date Format

    Hi
    I need to store a date into a flexfield. We have enabled the Flexfield and there is NO value set attached to it.
    This attribute is already in the VO as a varchar, so we have just added a new column into the page as data type Date and link it to the flexfield column.
    In this page we have a table layout so the user can enter 10 rows before saving them. And this page it just used to punch data into a table, which means, once the user press apply the page saves and clears. The user can not query on that page.
    When entering the first row, we can open the Date picker and we can choose the date and then it populates the column as “DD-MON-YYYY”.
    The problem is:
    When we entering the second row after entering one column the pages changes the format of my date from the previous record to “YYYY-MM-DD”, then after entering any second column the pages clear the date from the previous row.
    Running the page from JDev it shows the following message before clears the flexfield:
    java.text.ParseException: 2011-01-28
    Note we have not extended the VO and not extended the controller.
    My questions are:
    1) Why the Self-Service is change the date format to YYYY-MM-DD even if the profile ICX: Date Format Mask (31-DEC-1999) and my preference is set to DD-MON-YYYY?
    2) How can I avoid this to happen? Is there any way to keep my date as DD-MON-YYYY?
    Thanks,
    Alex

    Alex,
    That was the update from Oracle support, when we raised it,
    But I did the following to handle that, I feel this is not the right way, since we had that issue as SEV1, I did that as a workaround,
    Check this this might help.
    package oracle.apps.xxper.selfservice.appraisals.webui;
    import com.sun.java.util.collections.HashMap;
    import java.io.Serializable;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.webui.*;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageCheckBoxBean;
    import oracle.apps.per.selfservice.appraisals.ApprConstants;
    import oracle.apps.per.selfservice.arch.webui.PerOAControllerImpl;
    import oracle.apps.per.selfservice.common.webui.CommonCO;
    import oracle.apps.per.selfservice.compgaps.Constants;
    import oracle.apps.per.selfservice.appraisals.webui.MAFinalRatingsPageCO;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.OAViewObject;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import oracle.jbo.Row;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageDateFieldBean;
    import oracle.apps.per.selfservice.appraisals.server.AppraisalVORowImpl;
    public class XXPERMAFinalRatingsPageCO extends MAFinalRatingsPageCO
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    writeLog("XXPER",pageContext,"Start PR XXPERMAFinalRatingsPageCO ");
    OAMessageDateFieldBean dateBean =(OAMessageDateFieldBean) webBean.findChildRecursive("DeliveryDateTime");
    if(dateBean !=null )
    String dateBeanValue = (String) dateBean.getValue(pageContext) ;
    writeLog("XXPER",pageContext,"dateBean Value "+dateBeanValue);
    if(dateBeanValue !=null)
    if(dateBeanValue.indexOf(".0") !=-1)
    dateBeanValue = dateBeanValue.substring(0,dateBeanValue.length()-2);
    writeLog("XXPER",pageContext,"dateBean Updated Value "+dateBeanValue);
    String dateMaskQry = "SELECT value FROM V$NLS_Parameters WHERE parameter ='NLS_DATE_FORMAT'";
    writeLog("XXPER",pageContext,"dateMaskQry "+dateMaskQry);
    String dateMask = (String) executeSql(dateMaskQry, pageContext, webBean);
    writeLog("XXPER",pageContext,"dateMask : "+dateMask);
    String dateConvertQry = "select to_char(fnd_date.canonical_to_date('"+dateBeanValue+"') ,'"+dateMask+" HH24:MI:SS') from dual";
    writeLog("XXPER",pageContext,"dateConvertQry "+dateConvertQry);
    String convertedDateValue = (String) executeSql(dateConvertQry,pageContext,webBean);
    writeLog("XXPER",pageContext,"convertedDateValue "+convertedDateValue);
    if(convertedDateValue == null )
    convertedDateValue = dateBeanValue;
    dateBean.setValue(pageContext,convertedDateValue);
    writeLog("XXPER",pageContext,"After set the value "+convertedDateValue);
    setAttribute3(pageContext, convertedDateValue);
    writeLog("XXPER",pageContext,"After set the VO value "+convertedDateValue);
    }else
    writeLog("XXPER",pageContext,"dateBean value is null from the bean Get the value from getAttribute3() method");
    dateBeanValue = getAttribute3(pageContext);
    dateBean.setValue(pageContext,dateBeanValue);
    }else
    writeLog("XXPER",pageContext,"dateBean is null ");
    writeLog("XXPER",pageContext,"End PR XXPERMAFinalRatingsPageCO ");
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    writeLog("XXPER",pageContext,"Start PFR XXPERMAFinalRatingsPageCO ");
    writeLog("XXPER",pageContext,"Event Param "+pageContext.getParameter(EVENT_PARAM));
    OAMessageDateFieldBean dateBean =(OAMessageDateFieldBean) webBean.findChildRecursive("DeliveryDateTime");
    if(dateBean !=null )
    String dateBeanValue = (String) dateBean.getValue(pageContext) ;
    if(dateBeanValue !=null)
    if(dateBeanValue.indexOf(".0") !=-1)
    dateBeanValue = dateBeanValue.substring(0,dateBeanValue.length()-2);
    writeLog("XXPER",pageContext,"dateBean Updated Value "+dateBeanValue);
    String dateMaskQry = "SELECT value FROM V$NLS_Parameters WHERE parameter ='NLS_DATE_FORMAT'";
    writeLog("XXPER",pageContext,"dateMaskQry "+dateMaskQry);
    String dateMask = (String) executeSql(dateMaskQry, pageContext, webBean);
    writeLog("XXPER",pageContext,"dateMask : "+dateMask);
    String dateConvertQry = "select to_char(fnd_date.canonical_to_date('"+dateBeanValue+"') ,'"+dateMask+" HH24:MI:SS') from dual";
    //String dateConvertQry = "select fnd_date.string_to_canonical('"+dateBeanValue+"','"+dateMask+" HH24:MI:SS') from dual";
    writeLog("XXPER",pageContext,"dateConvertQry "+dateConvertQry);
    String convertedDateValue = (String) executeSql(dateConvertQry,pageContext,webBean);
    writeLog("XXPER",pageContext,"convertedDateValue "+convertedDateValue);
    if(convertedDateValue == null )
    convertedDateValue = dateBeanValue;
    dateBean.setValue(pageContext,convertedDateValue);
    writeLog("XXPER",pageContext,"After set the value "+convertedDateValue);
    setAttribute3(pageContext, convertedDateValue);
    writeLog("XXPER",pageContext,"After set the VO value "+convertedDateValue);
    }else
    writeLog("XXPER",pageContext,"dateBean is null ");
    writeLog("XXPER",pageContext,"End PFR XXPERMAFinalRatingsPageCO ");
    super.processFormRequest(pageContext, webBean);
    writeLog("XXPER",pageContext,"End PFR XXPERMAFinalRatingsPageCO (After Super Call )");
    public void writeLog(String moduleName, OAPageContext pageContext, String diagText)
    if(pageContext.isLoggingEnabled(OAWebBeanConstants.STATEMENT))
    System.out.println(moduleName+" : "+diagText);
    pageContext.writeDiagnostics(moduleName,diagText,OAWebBeanConstants.STATEMENT);
    * Method to execute SQL.
    public Object executeSql(String pSqlStmt, OAPageContext pageContext , OAWebBean webBean)
    OADBTransaction tx = pageContext.getApplicationModule(webBean).getOADBTransaction();// (OADBTransaction)getOADBTransaction();
    Object lObject = null;
    // Create the callable statement
    CallableStatement lCstmt = (CallableStatement)tx.createCallableStatement(pSqlStmt, 1);
    ResultSet rs = null;
    try
    rs = lCstmt.executeQuery();
    while(rs.next())
    lObject = rs.getObject(1);
    catch (Exception e)
    //throw OAException.wrapperException(e);
    finally
    try {
    if(rs!=null)
    rs.close();
    if(lCstmt != null)
    lCstmt.close();
    catch(Exception e) {
    throw OAException.wrapperException(e);
    return lObject;
    } // executeSql
    public void setAttribute3(OAPageContext pageContext, String dateValue)
    OAApplicationModule rootAM = pageContext.getRootApplicationModule();
    OAApplicationModule apprAM = (OAApplicationModule)rootAM.findApplicationModule("AppraisalsAM");
    OAViewObject appraisalVO = (OAViewObject)apprAM.findViewObject("AppraisalVO");
    writeLog("XXPER",pageContext,"appraisalVO "+appraisalVO);
    if(appraisalVO !=null)
    AppraisalVORowImpl appraisalVORow = (AppraisalVORowImpl) appraisalVO.getCurrentRow();
    if(appraisalVORow !=null)
    int attrCount = appraisalVO.getAttributeCount();
    writeLog("XXPER",pageContext,"Attrbuute count "+attrCount);
    String[] attributeNames = appraisalVORow.getAttributeNames();
    appraisalVORow.setAttribute3(dateValue);
    public String getAttribute3(OAPageContext pageContext)
    OAApplicationModule rootAM = pageContext.getRootApplicationModule();
    OAApplicationModule apprAM = (OAApplicationModule)rootAM.findApplicationModule("AppraisalsAM");
    String attribute3Value = "N";
    OAViewObject appraisalVO = (OAViewObject)apprAM.findViewObject("AppraisalVO");
    writeLog("XXPER",pageContext,"appraisalVO "+appraisalVO);
    if(appraisalVO !=null)
    AppraisalVORowImpl appraisalVORow = (AppraisalVORowImpl) appraisalVO.getCurrentRow();
    if(appraisalVORow !=null)
    int attrCount = appraisalVO.getAttributeCount();
    writeLog("XXPER",pageContext,"Attrbuute count "+attrCount);
    String[] attributeNames = appraisalVORow.getAttributeNames();
    writeLog("XXPER",pageContext," AppraisalId :- "+ appraisalVORow.getAppraisalId());
    attribute3Value = (String)appraisalVORow.getAttribute3();
    String attribute1Value = (String)appraisalVORow.getAttribute1();//getAttribute2
    String attribute2Value = (String)appraisalVORow.getAttribute2();
    writeLog("XXPER",pageContext," attribute3Value :- "+attribute3Value + " attribute1Value "+ attribute1Value +"attribute2Value "+attribute2Value);
    }else
    writeLog("XXPER",pageContext," appraisalVORow is null ");
    }else
    writeLog("XXPER",pageContext," appraisalVO is null ");
    return attribute3Value;
    }

  • How to extract  different date format in text file

    well, iam new for using regex api(regular expression), In my project i want to extract the different format of date from the text file... date format will be 3rd june 2004, 03-06-2004, june 3rd and so on....
    can any body give me regular expression to extract the date from the text file...
    i will be very grateful..
    kareem

    date format will be 3rd june 2004, 03-06-2004, june 3rd and so on....The only way to do this (without implementing a "mind reader") is to determine in advance all the possible date formats that are possible in your input, and try to interpret each date using each of those formats until one of them passes.
    It's easy enough to handle june 3rd vs 3 june vs 3rd june, but 6/3 vs 3/6, of course, is ambiguous.

  • A question about BPEL data formats

    Hi everyone,
    I am new to BPEL and have a question regarding the format of data "inside" BPEL variables. Perhaps someone can clear this up?
    When defining a variable in BPEL, I can either give it an XML Schema simple or complex type - or a "WSDL message type". I am confused with regard to the last one. A WSDL message has parts, and the parts have types themselves. These types, however, can be from an arbitrary type language. XML Schema is one possibility, but there might be others. I have two questions with regard to this:
    1) If I use some proprietary schema instead of XML Schema, can I handle data in this format in the BPEL process? I.e., can I assign "literal" data to the parts in my own format, and (if it is XML-based) manipulate it with XPath?
    2) WSDL allows the definition of styles and encodings in the concrete part. How does the conversion happen between what's on the wire (in the SOAP body) and inside the BPEL variables? I.e. when using RPC/Encoded, does the Oracle BPEL engine automatically convert everything into plain-XML-Schema-validated-XML and back or does RPC/Encoded XML show up inside the variables? What if the BPEL engine doesn't understand the concrete format?
    Thanks a lot!
    Reto

    Fabio,
    I am not sure I understood you clearly. But ODI uses the underlying technology of the target database to perform the CDC. There are several KMs for each technology that let you achieve the same.
    eg. For Oracle, a trigger based CDC is available which creates triggers on the underlying tables in the database to capture the changes.
    Also for Oracle, a Logminer based CDC is available which reads the Oracle logs to capture the changes made over to tables.

  • Date Format in 'HH:MI' - help needed

    I have a table details that contains time_status column of Timestamp datatype.
    Data is stored in the column in the format '1/1/2008 10:31:00.000000 AM'.
    Now I want to select the data in HH:MI fopmat only.
    i.e., for '1/1/2008 10:31:00.000000 AM' I should get 10:31.
    I have written as select to_char(time_status,'HH:MI') from dual;
    I am getting an error when this query is included in the procedure.
    When I am executing outside, its is working.
    Also, How can I get the format a '1/1/2008 10:31'.
    Thanks in advance.
    Regards
    Raghunadh.

    I have a table details that contains time_status column of Timestamp datatype.Good. Always use the correct datatype. Either date or timestamp.
    Data is stored in the column in the format '1/1/2008 10:31:00.000000 AM'.
    Wrong! A timestamp or also a date column has no format! Same as a number column has no format.
    Now I want to select the data in HH:MI fopmat only. i.e., for '1/1/2008 10:31:00.000000 AM' I should get 10:31.When you work with date and timestamps you don't need any format. When you display the value, then you need to change your date into a string. Only during this transformation formatting takes place.
    Example:
    SQL*Plus: Release 9.2.0.2.0 - Production on Thu Aug 21 10:45:17 2008
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    /* lets do a simple date select */
    SQL> select sysdate from dual;
    SYSDATE
    21-AUG-08
    "Attention!" Sql*Plus did an implizit date to string conversion to show this value on the screen.
    It used the NLS settings for the format.
    /* Now lets change the nls settings */
    SQL> alter session set nls_date_format = 'FMddth Month YYYY';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    21st August 2008
    SQL>
    "Different output for the same query! Value is the same, only the formatting was changed."
    I have written as select to_char(time_status,'HH:MI') from dual;You should ask yourself, why do I want this string?
    I am getting an error when this query is included in the procedure.
    When I am executing outside, its is working.
    Also, How can I get the format a '1/1/2008 10:31'.Check the documentation (sql manual) for the many options for the date format settings. Also check for timestamps, they are a bit more difficult to handle than dates.
    Thanks in advance.
    Regards
    Raghunadh.You're welcome.

  • Convert Date format from YYYYMMDD to MM/DD/YYYY --issue with Mapping

    Hi All ,
    I have IDOC(DESADV.DELVRY03-> file ) scenario which i am working on . While debugging noticed that the field :
    E1EDT13\NATNZ -Data Transformation(from yyyymmdd to mm/dd/yyyy)-Target .This works
    But say if IDOC doesn't pass any value (For Good's issue) I get Error during debugging : RuntimeException in Message-Mapping transformation: Unparseable date: ""
    I did check thsi blog : Convertinf Date format from YYYY-MM-DD to MMDDYYYY  but this is  about the Data Transformtaion.
    I tried using constants , create if , -these function doesn't work /not applicle in this case
    Could you please provide  inputs as to how to handle two condition :
    1. With date -- then transform
    2.Else , pass nothing

    Hi Varalakshmi,
    Plese try to use UDF for date conversion and include logic which would check the Space value from the source structure.
    so if there is space return as such
    else.
    perform the conversion logic.
      Convertinf Date format from YYYY-MM-DD to MMDDYYYY
    (The conversion logic has been provided by micheal in the thread you have provided in the query)
    Thanks,
    Ram.

Maybe you are looking for