OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Loader and Dumper

V4.3.4
  • Document Overview
  • Introduction
  • Technical Mechanism
  • Preparations
    • Prepare the environment
    • Prepare data
    • Download OBLOADER & OBDUMPER
    • Startup parameters
  • User Guide (OBLOADER)
    • Quick start
    • Command-line options
    • Direct load
    • Data processing
      • Define a control file
      • Preprocessing functions
      • Case expressions
    • Use cases of command-line options
    • Performance tuning
    • Error handling
    • FAQ
  • User Guide (OBDUMPER)
    • Quick start
    • Command-line options
    • Data processing
      • Define a control file
      • Preprocessing functions
      • Case expressions
    • Performance tuning
    • FAQ
  • Security Features
  • Connection configuration
  • Self-service Troubleshooting
  • Release Note
    • Release Note
      • 4.x
        • OBLOADER & OBDUMPER V4.3.4
        • OBLOADER & OBDUMPER V4.3.3.1
        • OBLOADER & OBDUMPER V4.3.3
        • OBLOADER & OBDUMPER V4.3.2.1
        • OBLOADER & OBDUMPER V4.3.2
        • OBLOADER & OBDUMPER V4.3.1.1
        • OBLOADER & OBDUMPER V4.3.1
        • OBLOADER & OBDUMPER V4.3.0
        • OBLOADER & OBDUMPER V4.2.8.2
        • OBLOADER & OBDUMPER V4.2.8.1
        • OBLOADER & OBDUMPER V4.2.8
        • OBLOADER & OBDUMPER V4.2.7
        • OBLOADER & OBDUMPER V4.2.6
        • OBLOADER & OBDUMPER V4.2.5
        • OBLOADER & OBDUMPER V4.2.4
        • OBLOADER & OBDUMPER V4.2.1
        • OBLOADER & OBDUMPER V4.1.0
        • OBLOADER & OBDUMPER V4.0.0
      • 3.x
        • OBLOADER \& OBDUMPER V3.1.0
        • OBLOADER \& OBDUMPER V3.0.0
    • Versioning rules

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Loader and Dumper
  3. V4.3.4

Case expressions

Last Updated:2026-09-04 08:19:57

Syntax
Logical operation
Arithmetic operation

You can use case expressions to define a control file. This enables you to accomplish complex data processing tasks by performing simple logical and arithmetic operations.

Syntax

The following example shows the syntax of a case expression:

--Simple Case expression
CASE <expr> WHEN <constant>  THEN [constant | epxr] ELSE [constant | expr] END;

-- Search Case expression
CASE WHEN <condition> THEN [constant | expr] ELSE [constant | expr] END;

The parameter <expr> indicates case operation expressions. The following table shows valid values.

Expression
Return type
Description
is [not] null Boolean Verifies whether the value is null.
Example: case when col1 is null then 'Y' else 'N' end;.
not <condition> Boolean Takes the inverse of the true value of the case expression.
Example: case when not col1 is null then 'N' else 'Y' end;.
[not] in (string_list) Boolean Verifies whether values in a column exist in the specified list.
Example: case when col1 in ('1','3') then 'Y' else 'N' end;.

Logical operation

You can use case expressions to perform simple logical operations. Priority customization is not supported. The default priority of operations is determined by the sequence of expressions.

Logical operations include the AND/&& and OR/|| operations. Example:

CASE
  WHEN LENGTH(TRIM(C1)) = 17 AND SUBSTR(TRIM(C1, 13, 2)) < 60 
    THEN TO_TIMESTAMP(TRIM(TRIM(C1), 'yyyyMMddHHmmssSSS'))
  WHEN LENGTH(TRIM(C1)) = 17 
    THEN SYSTIMESTAMP
  ELSE TO_TIMESTAMP('00010101000000000', 'yyyyMMddHHmmssSSS')
END;

Arithmetic operation

You can use case expressions to perform simple arithmetic operations. Priority customization is not supported. The default priority of operations is determined by the sequence of expressions.

Arithmetic operations include addition (+), subtraction (-), multiplication (*), division (/), and modulus operation (MOD). Example:

CASE 
  WHEN TRIM(C1)+1>2 THEN '>2' 
  WHEN TRIM(C1)+1=2 THEN '=2' 
  ELSE '<2' 
END;

Previous topic

Preprocessing functions
Last

Next topic

Performance tuning
Next
on this page
Syntax
Logical operation
Arithmetic operation