All Products
Search
Document Center

Task

Last Updated: Dec 11, 2019

Currently, DMS Enterprise supports the following data development tasks:

  • Execute SQL statements on databases residing on the same instance

Variable configuration

System variable

The bizdate variable is the only system variable, indicating the previous day of the day when the task is executed. By default, the value is in the yyyy-MM-dd format.

  • For example, if the task was run on August 15, 2019, the value of the bizdate variable is 2019-08-14.

Custom variables

You can customize variables with the bizdate variable as the reference. To set custom variables, click Variable Settings on the right of the task tab. Custom variables

Format

In SQL statements, variables are in the ${Variable name} format.

Usage

After you set a custom variable, the relevant SQL statement displays the value of the variable. To check whether the custom variable is set successfully, click SQL Preview on the task tab.

  • For example, set the yesterday variable, as shown in the following figure. yesterday
  • If the yesterday variable is set successfully, the variable value is displayed in the SQL statement, as shown in the following figure. Preview

Supported time formats

Letter Description Example
G Anno domini (AD). Format: Gyyyy. Example: AD2019.
y The year of the day when the task is run. Format: yyyy or yy. Example: 2019 or 19.
Y The year of the week when the task is run. Format: YYYY. For example, if the value of bizdate is 2019-12-31, the task is run on the next day, that is January 1, 2020. As a result, the year of the week when the task is run is 2020.
M The month of the year when the task is run. Format: MM. Example: 08.
w The week of the year when the task is run. Format: ww. Example: 01.
W The week of the month when the task is run. Format: W. Example: 1.
D The day of the year when the task is run. Format: D. Example: 360.
d The day of the month when the task is run. Format: dd. Example: 02.
E The day of the week when the task is run. Format: E. Example: Saturday.
a Ante meridiem (a.m.). Format: a, indicating a.m.
H The hour of the day when the task is run. Value range: [0, 23]. Format: HH. Example: 10.
k The hour of the day when the task is run. Value range: [1, 24]. The value 24 indicates 00:00. Format: kk. Example: 11.
K The hour of the half day, either before the midday or after the midday, when the task is run. Value range: [0, 11]. Format: KK. Example: 01.
h The hour of the half day, either before the midday or after the midday, when the task is run. Value range: [1, 12]. Format: hh. Example: 02.
m The minute of the hour when the task is run. Format: mm. Example: 35.
s The second of the minute when the task is run. Format: ss. Example: 12.
S The milisecond of the second when the task is run. Format: SSS. Example: 079.
z The time zone. Format: z. Example: UTC+08:00.

Example

  • Assume that the time is 2019-08-02 11:05:21:
    • In the format of yyyy-MM-dd, the value is 2019-08-02.
    • In the format of HH:mm:ss, the value is 11:05:21.
    • In the format of yyyyMMdd HH:mm:ss, the value is 20190802 11:05:21.
    • In the format of yyyyMM01, indicating the beginning of the month, the value is 20190801.