Example: Loading current timestamps

The massload utility is given the following information to update the offer with an OFFER_ID of 10123. The start date has a value of CURRENT TIMESTAMP, and the end date has a value of CURRENT TIMESTAMP + 14 DAYS.

Feature Pack 6 or laterThe massload utility is deprecated for WebSphere Commerce Version 7 Feature Pack 6. The Data Load utility is the recommended command-line loading utility. If you are currently using the mass load utility, you are recommended to switch to the Data Load utility to load your CSV and XML input files into your target database. If your system contains scheduled and automated processes that use massload, it is recommended that you update these processes to use the Data Load utility. Other WebSphere Commerce utilities that use the massload utility, such as the acpload utility, continue to use the massload utility in WebSphere Commerce Version 7 Feature Pack 6. If you have business reasons to continue using the massload utility, you can continue to use this utility. For more information about the Data Load utility, see Overview of the Data Load utility. You can switch to the Data Load utility by using the TableObjectMediator to load your data when no business object mediator exists for the data that you are loading. For more about the TableObjectMediator formation, see Data Load utility table-based mediator and builder.


  <OFFER 
    OFFER_ID="10123"
    STARTDATE="CURRENT TIMESTAMP">
    ENDDATE="CURRENT TIMESTAMP + 14 DAYS"
  />

The massload utility recognizes that the columns STARTDATE and ENDDATE are of a timestamp data type in the database. Based on the CurrentTimeStampLiteral property, the values are determined to have values that are specified in the current-timestamp format. The value for STARTDATE matches the InputCurrentTimeStampFormat.1 pattern, and it is converted to the pattern specified by the CurrentTimeStampFormat.JDBC property. The value for ENDDATE matches the format of the InputCurrentTimeStampFormat.2 property, and it is also converted to the pattern specified by the CurrentTimeStampFormat.JDBC property.

Examples of adding durations to current timestamps

The massload utility gives you the ability to add durations to current timestamps. For example, you might want to load an offer without inputting a specific date. To do that, you must create an end date that is some duration after the start date. The following example works well with DB2:


  <Offer
    Startdate="Current Timestamp"
    Enddate="Current Timestamp +14 Days +4 Months +1 Year +0 Hours 
      +0 Minutes +0 Seconds"
  />

To handle current-timestamp durations in a platform-independent way, however, you must customize the current-timestamp formats by modifying the masks in the massload utility customizer property file. Here is an example of customized current-timestamp property specifications:


  CurrentTimestampLiteral=Current Timestamp

  InputCurrentTimestampFormat.0=Current Timestamp
  InputCurrentTimestampFormat.1=Current Timestamp %D Days
  InputCurrentTimestampFormat.2=Current Timestamp %M Months
  InputCurrentTimestampFormat.3=Current Timestamp %Y Years
  InputCurrentTimestampFormat.4=Current Timestamp %D Days %M Months
  InputCurrentTimestampFormat.5=Current Timestamp %D Days %M Months
%Y Years
  InputCurrentTimestampFormat.6=Current Timestamp %D Days %M Months
%Y Years %H Hours %m Minutes %s Seconds

  CurrentTimestampFormat.JDBC=Current Timestamp %D Days %M Months
%Y Years %H Hours %m Minutes %s Seconds

Using the offer example and these property specifications, the end date for the offer matches the InputCurrentTimestampFormat.6 pattern. This pattern yields the following offer information by using the CurrentTimestampFormat.JDBC.


  <Offer
    Startdate="Current Timestamp"
    Enddate="Current Timestamp +14 Days +4 Months +1 Year +0 Hours
+0 Minutes +0 Seconds"
  />

The preceding example shows how the massload utility can input multiple current-timestamp formats and format them appropriately to a wanted output format.