OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Developer Center

V4.4.0

  • Topics Overview
  • Overview
    • What is ODC?
    • Features
    • Architecture
    • Limitations
    • ODC console
  • Quick Start
    • Client ODC
      • Overview
      • Install Client ODC
      • Use Client ODC
    • Web ODC
      • Overview
      • Deploy Web ODC
      • Use Web ODC
  • Data Source Management
    • Create a data source
    • Data sources and project collaboration
    • Database O&M
      • Session management
      • Global variable management
      • Recycle bin management
  • SQL Development
    • Edit and execute SQL statements
    • Perform PL compilation and debugging
    • Use the command-line window
    • Edit and export the result set of an SQL statement
    • Execution analysis
    • Generate test data
    • System settings
    • Database objects
      • Table objects
        • Overview
        • Create a table
      • View objects
        • Overview
        • Create a view
        • Manage views
      • Materialized view objects
        • Overview
        • Create a materialized view
        • Manage materialized views
      • Function objects
        • Overview
        • Create a function
        • Manage functions
      • Stored procedure objects
        • Overview
        • Create a stored procedure
        • Manage stored procedures
      • Sequence objects
        • Overview
        • Create a sequence
        • Manage sequences
      • Package objects
        • Overview
        • Create a program package
        • Manage program packages
      • Trigger objects
        • Overview
        • Create a trigger
        • Manage triggers
      • Type objects
        • Overview
        • Create a type
        • Manage types
      • Synonym objects
        • Overview
        • Create a synonym
        • Manage synonyms
  • Import and Export
    • Import schemas and data
    • Export schemas and data
  • Database Change Management
    • Manage user permissions
      • Users and roles
      • Automatic authorization
      • User permission management
    • Project collaboration management
    • Risk levels, risk identification rules, and approval processes
    • SQL check specifications
    • SQL window specification
    • Database change management
    • Manage changes to logical databases
    • Batch database change management
    • Online schema changes
    • Synchronize shadow tables
    • Schema comparison
  • Data Lifecycle Management
    • Data archiving
    • Data cleanup
    • Manage partitioning plans
      • Manage partitioning plans
      • Set partitioning strategies
      • Examples of partitioning strategies
    • SQL plan task
  • Data Masking and Auditing
    • Desensitize data
    • Operation records
  • Notification Management
    • Overview
    • View notification records
    • Manage notification channels
      • Create a notification channel
      • View, edit, and delete a notification channel
      • Configure a custom channel
    • Manage notification rules
  • System Integration
    • Login integration
    • Approval integration
    • SQL approval integration
    • Bastion host integration
  • Deployment Guide
    • Deployment overview
    • Preparations before deployment
    • Deploy ODC in single-node mode
    • Deploy ODC in high-availability mode
    • Deployment verification
  • Upgrade Guide
    • Upgrade Overview
    • Preparations before upgrade
    • Update single-node ODC
    • Update high-avaliability ODC
    • Upgrade verification
    • Rollback after upgrade failed
  • Best Practices
    • Tips for SQL development
    • Explore ODC team workspaces
    • Understanding real-time SQL diagnostics for OceanBase AP
    • OceanBase historical database solutions
    • ODC SQL check for automatic identification of high-risk operations
    • Integration with ODC enterprise-level account system
    • Manage and modify sharded databases and tables via ODC
    • Data masking and control practices
    • Enterprise-level control and collaboration: Safeguard every database change
  • Troubleshooting
    • ODC troubleshooting process
    • Collect message
      • View the runtime environment and version information
      • View web ODC logs
      • View client ODC logs
      • View end-to-end ODC-related logs
      • View ODC MetaDB data
      • Query the index status in OceanBase Database V4.x
      • Query the index status in OceanBase Database V1.4.x to V3.2.x
      • Collect JVM runtime information
      • Use tcpdump to capture packets
    • FAQ
      • Installation of client ODC
      • Web ODC deployment and startup
      • Connection Information
      • Command-line window
      • DDL statement display
  • Common features
  • Release Notes
    • V4.4
      • ODC V4.4.0
    • V4.3
      • ODC V4.3.4
      • ODC V4.3.3
      • ODC V4.3.2
      • ODC V4.3.1
      • ODC V4.3.0
    • V4.2
      • ODC V4.2.4
      • ODC V4.2.3
      • ODC V4.2.2
      • ODC V4.2.1
      • ODC V4.2.0
    • V4.1
      • ODC V4.1.3
      • ODC V4.1.2
      • ODC V4.1.1
      • ODC V4.1.0
    • V4.0
      • ODC V4.0.2
      • ODC V4.0.0
    • V3.4
      • ODC V3.4.0
    • V3.3
      • ODC V3.3.3
      • ODC V3.3.2
      • ODC V3.3.1
      • ODC V3.3.0
    • V3.2
      • ODC V3.2.3
      • ODC V3.2.2
      • ODC V3.2.1
      • ODC V3.2.0

Download PDF

Topics Overview What is ODC? Features Architecture Limitations ODC console Overview Install Client ODC Use Client ODC Overview Deploy Web ODC Use Web ODC Create a data source Data sources and project collaboration Session management Global variable management Recycle bin management Edit and execute SQL statements Perform PL compilation and debugging Use the command-line window Edit and export the result set of an SQL statement Execution analysis Generate test data System settings Import schemas and data Export schemas and data Users and roles Automatic authorization User permission management Project collaboration management Risk levels, risk identification rules, and approval processes SQL check specifications SQL window specification Database change management Manage changes to logical databases Batch database change management Online schema changes Synchronize shadow tables Schema comparison Data archiving Data cleanup Manage partitioning plans Set partitioning strategies Examples of partitioning strategies SQL plan task Desensitize data Operation records Overview View notification records Create a notification channel View, edit, and delete a notification channel Configure a custom channel Manage notification rules Login integration Approval integration SQL approval integration Bastion host integration Deployment overview Preparations before deployment Deploy ODC in single-node mode Deploy ODC in high-availability mode Deployment verification Upgrade Overview Preparations before upgrade Update single-node ODC Update high-avaliability ODC Upgrade verification Rollback after upgrade failed Tips for SQL development Explore ODC team workspaces Understanding real-time SQL diagnostics for OceanBase AP OceanBase historical database solutions ODC SQL check for automatic identification of high-risk operations Integration with ODC enterprise-level account system Manage and modify sharded databases and tables via ODC Data masking and control practices Enterprise-level control and collaboration: Safeguard every database change ODC troubleshooting process View the runtime environment and version information View web ODC logs View client ODC logs View end-to-end ODC-related logs View ODC MetaDB data Query the index status in OceanBase Database V4.x Query the index status in OceanBase Database V1.4.x to V3.2.x Collect JVM runtime information Use tcpdump to capture packets Installation of client ODC Web ODC deployment and startup Connection Information Command-line window DDL statement display Common features ODC V4.4.0 ODC V4.3.4 ODC V4.3.3 ODC V4.3.2 ODC V4.3.1 ODC V4.3.0 ODC V4.2.4
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Developer Center
  3. V4.4.0
iconOceanBase Developer Center
V 4.4.0
  • V 4.4.2
  • V 4.4.1
  • V 4.4.0
  • V 4.3.4
  • V 4.3.3
  • V 4.3.2
  • V 4.3.1
  • V 4.3.0
  • V 4.2.4
  • V 4.2.3
  • V 4.2.2
  • V 4.2.1
  • V 4.2.0
  • V 4.1.3 and earlier

Create a table

Last Updated:2026-04-07 10:00:35  Updated
share
What is on this page
Background information
Logical table
Create an internal table
Create an external table
Procedure
Create an internal table
Create an external table
References

folded

share

OceanBase Developer Center (ODC) allows you to visualize the creation of tables. This topic describes how to create a table in the ODC console.

Background information

Logical table

ODC V4.3.2 and later allow you to configure multiple (or a single) physical database as a logical database and create logical tables to query and manage a large number of databases and tables. For more information, see Manage logical databases.

Note

If you do not have the required privileges on the logical database, you can apply for the required privileges in the Apply for database privileges section on the project or ticket page.

Logical table expression rules

Rule type Rule name Example
Simple rules Sequential order db.test_[0-7]: creates eight tables.
Aligned sequential order
  • db.test_[00-07]: creates eight tables with two-digit alignment.
  • db.test_[000-007]: creates eight tables with three-digit alignment.
  • db.test_[0000-0007]: creates eight tables with four-digit alignment.
Prefix-based sequential order (without prefix padding) db.test_[0-8:2]: creates five tables with a step length of 2 (db.test_0, db.test_2, db.test_4, db.test_6, and db.test_8).
Prefix-based sequential order (with zero-padded prefix) db.test_[00-07:3]: creates three tables with a step length of 3 (db.test_00, db.test_03, and db.test_06).
Centered order db.test_[00-31]_t: suffix shadow table.
Multi-level rules Date-based order db.test_[01-12]_[01-31]: creates tables with 12 months and 31 days each, that is, 12 × 31 tables.
Multi-level sequential order db.test_[01-12:2]_[01-31:2]: creates tables for single months (1, 3, 5, ..., 11) with odd days in each month (1, 3, 5, ..., 31), that is, 6 × 16 tables.
Rules for databases and linked tables Same-name rule db_[00-31].test: defines a test table in each database from db_00 to db_31.
Evenly distributed rule db_[00-31].test[0000-1023]: evenly distributes a total of 1,024 tables across each database from db_00 to db_31.
Enumeration rules Simple enumeration db.test_[1,3,6,8,9]: creates five tables in the specified database.
Complex enumeration rule Evenly distributes tables across specified databases by using multiple expressions: db.test_[1,3,6,8,9] and db.test_[2,4,5,7,10].
Enumeration rules for databases Create the same rule in databases db_[00-31].test_[[00-31]]: creates tables that match test_[00-31] in each database from db_00 to db_31.
Enumeration in databases db_01.test_[1,2,4,6,7],db_02.test_[2,3,5,7,9],db_03.test_[1,4,6,7,9]: creates five tables in each of the three databases.
Uneven tables in databases db_01.test_[1-7],db_02.test_[10-15]: creates seven tables in database db_01 and six tables in database db_02.

Create an internal table

1

The preceding figure shows the seven steps involved in creating an internal table:

  1. Specify the basic information.

  2. Set columns.

  3. Set indexes.

  4. Set constraints.

  5. Set partitioning rules.

  6. Verify the SQL statement.

  7. Complete the table creation.

Create an external table

An external table is a logical table object. Its data is stored in an external storage system instead of the database. For more information, see Overview.

ODC V4.3.3 and later versions support creating external tables by executing SQL commands in the SQL window, which maps external files to the ODC database via specified file paths. You can view the created external tables from the resource tree list. For details, please refer to OceanBase Create External Table.

You can use the CREATE EXTERNAL TABLE statement to create an external table.

Notice

  • External tables are read-only. You can query an external table, but cannot perform DML operations on external tables.
  • You need to specify the secure_file_priv variable before you create an external table in ODC by using a local file. To specify the variable, you can connect to OceanBase Database only by using a local Unix socket. ODC does not support this connection method, and you must use OBClient to configure the connection.
  1. Create an external file.
  2. Create an external table in the SQL window of ODC by executing SQL statements.
  3. View the external table in the resource tree.

Procedure

Create an internal table

The following example describes how to create a table named employee in the odc_test database in the SQL window. The table contains the emp_no, birthday, name, and gender columns.

Note

All data in this example is for reference only. You can replace the data as needed.

Create a table in the physical database
Create a table in a logic database

Step 1: Specify the basic information

  1. Log in to the database and go to the SQL window. You can click Table in the left-side navigation pane to view tables. To create a table, click + next to Table Name in the table list.

  2. On the create table tab that appears, set the Table Name, Storage Mode, and Description parameters.

    step 1

    Note

    • In MySQL compatible mode, you also need to set the default character set and default collation.
    • After you specify the basic information and go to the "Set columns" step, the basic information is submitted.
    • OceanBase Database V4.3.0 and later allow you to configure columnar storage.

Step 2: Set columns

Note

ODC V4.2.3 and later allow you to create a table that contains fields of spatial data types in OceanBase MySQL compatible mode or MySQL.

The following figure shows the information that you need to specify when you add a column.

step 2

Note

  • After you copy a row, you can paste the row by using the Command+V or Ctrl+V shortcut keys.
  • The auxiliary editing section at the bottom of the page displays additional information about the selected column.
  • The basic information and column settings are required. The settings in other parameters are optional. After you specify the basic information and column settings, you can submit the settings and confirm the SQL statement to create the table.

Step 3: Set indexes

If a table contains a large amount of data, you can use indexes to accelerate data queries. An index is a data structure that pre-sorts the values of one or more columns in a table. You can directly locate records that meet the conditions by using indexes.

The following figure shows the information that you need to specify when you set an index.

step 3

Step 4: Set constraints

Constraints are used to specify data rules for a table. A data operation that violates the constraints is terminated.

step 4

ODC allows you to set the following four types of table constraints:

  • Primary Key Constraint: defines a primary key to uniquely identify each row of data in the table. A primary key constraint can be a field or a group of fields. You can set only one primary key constraint for a table, and you cannot modify the primary key constraint after you configure the constraint.

  • Unique Constraint: ensures that the data in a field or a group of fields is unique in the table. You can set multiple unique constraints in one table.

  • Foreign Key Constraint: establishes a connection between one or more columns in the data of two tables. The foreign key constraint maintains the data consistency and integrity between associated tables. After you set the foreign key constraint, you cannot create a new one or modify the existing one.

  • Check Constraints: verifies the data in the database based on the configured check rules when you edit the data, and allows you to modify the data only if the data verifies.

Step 5: Set partitioning rules

step 5

You can partition a table that contains a large amount of data. After a table is partitioned, data of the table is stored in multiple tablespaces. The system does not scan the entire table each time it queries data. In ODC V4.3.3 and later, you can view subpartitions.

  • In MySQL compatible mode, OceanBase Database supports the following six partitioning methods: KEY, HASH, RANGE, RANGE COLUMNS, LIST, and LIST COLUMNS.

  • In Oracle compatible mode, OceanBase Database supports the following three partitioning methods: LIST, RANGE, and HASH.

Step 6: Confirm the SQL statement

step 6

After you click Submit, you can view the statement on the SQL confirmation page. You can perform SQL Check and Format operations on the statement to facilitate viewing.

The syntax is as follows:

CREATE TABLE table_name (column_name column_type, column_name column_type,.......);

The following table describes the parameters.

Parameter Description
CREATE TABLE The CREATE TABLE statement creates a table with a specified name. You must have the privilege to create tables.
table_name The name of the table. The table name must conform to the identifier naming rules.
column_name column_type The name and data type of each column in the table. Separate the tuples of multiple columns with commas (,).

Step 7: Complete the table creation

Click Execute. After the table is created, the employee table appears in the table list in the left-side navigation pane.

step 7

Note

You can click the More icon next to a table name in the table list in the left-side navigation pane, and select View Table Schema, View Table Data, Import, Export, Download, Mock Data, New SQL Window, Copy, Delete, or Refresh from the context menu to manage or operate the table.

You can use the SELECT statement to query data in the new table.

The syntax is as follows:

SELECT
 column_name,
 column_name
FROM
 table_name [WHERE Clause] [LIMIT N] [ OFFSET M]

The following table describes the parameters.

Parameter Description
SELECT The keyword that indicates the name of the statement. You can use the SELECT statement to read one or more records.
column_name The name of the column to be queried. An asterisk (*) indicates to query all columns.
WHERE The keyword of the condition clause.
LIMIT The number of records to be returned.
OFFSET The data offset for the SELECT statement. By default, the offset is 0.

Here is an example:

SELECT `emp_no`, `birthdate`, `name`, `gender` FROM `employee`;

7.2

Step 1: Specify the basic information

  1. Log in to the database and go to the SQL window. You can click Table in the left-side navigation pane to view tables. To create a table object, click + next to Table in the left-side navigation pane.

  2. On the create table tab that appears, set the Basic Info parameters such as Logical Table Expression and Description.

    Notice

    • The logical table expression must contain the database name. In the odc_test.employee[00-09] expression, for example, odc_test indicates the database name, employee indicates the table name, and [00-09] indicates to create 10 tables.
    • The default name of the generated logical table consists of the non-number strings shared by the physical tables. For example, if the names of the physical tables are db.test_0, db.test_1, db.test_2, and db.test_3, the generated logical table is named test, and its expression is db.test_[0-3]. For more information, see the description of logical table expression rules.

Step 2: Set columns

The following figure shows the information that you need to specify when you add a column.

Note

  • After you copy a row, you can paste the row by using the Command+V or Ctrl+V shortcut keys.
  • The auxiliary editing section at the bottom of the page displays additional information about the selected column.
  • The basic information and columns parameters are required. The other parameters are optional. After you specify the basic information and columns parameters, you can submit the parameters and confirm the SQL statement to create the table.

Step 3: Set indexes

If a table contains a large amount of data, you can use indexes to accelerate data queries. An index is a data structure that pre-sorts the values of one or more columns in a table. By using indexes, you can directly locate records that meet the conditions.

The following figure shows the information that you need to specify when you set an index.

Step 4: Set constraints

Constraints are used to specify data rules in a table. A data operation that violates the constraints is terminated.

ODC supports the following four types of table constraints:

  • Primary Key Constraint: A primary key uniquely identifies each row of data in a table. A primary key constraint is one or more fields that uniquely identify each row of data in a table. You can set only one primary key constraint for a table, and you cannot modify the primary key constraint after you configure the primary key constraint.

  • Unique Constraint: Ensures that data in one or more fields is unique in the table. You can set multiple unique constraints for one table.

  • Foreign Key Constraint: A foreign key is one or more columns that establish a link between the data in two tables. The foreign key constraint maintains the data consistency and integrity between associated tables. After you configure a foreign key constraint, you cannot create a new foreign key constraint or modify the existing foreign key constraint.

  • Check Constraints: The check constraint verifies the data in the database based on the configured check rules when you edit the data. Data modification is allowed only after the verification is passed.

Step 5: Set partitioning rules

You can partition a table that contains a large amount of data. After a table is partitioned, data of the table is stored in multiple tablespaces. The system does not scan the entire table each time it queries data.

  • In MySQL compatible mode, OceanBase Database supports the following partitioning methods: KEY, HASH, RANGE, RANGE COLUMNS, LIST, and LIST COLUMNS.

  • In Oracle compatible mode, OceanBase Database supports the following three partitioning methods: LIST, RANGE, and HASH.

Step 6: Confirm the SQL statement

After you click Commit, you can view the statement on the SQL confirmation page. You can also click Format to format the statement for easier viewing.

The syntax is as follows:

CREATE TABLE table_name (column_name column_type, column_name column_type,.......);

Parameter description: | Parameter | Description | | --- | --- | | CREATE TABLE | Creates a table with the specified name. You must have the privilege to create tables. | | table_name | The name of the table created. The table name must conform to the identifier naming rules. |

| column_name column_type | specifies the name and data type of each column in the table. Separate the names of multiple columns with commas (,). |

Step 7: Complete the table creation process.

Click Execute. After the table is created, the employee table appears in the table list in the left-side navigation pane.

Create an external table

The example in this section describes how to create an external table named employee in the odc_test database in the SQL window by mapping the specified file in Alibaba Cloud OSS to the odc_test database.

  1. Create an external file.

    1. Create a directory named external table on the OSS console.

    2. Upload the employee.csv file to the external table directory.

    3. Copy the path of the employee table, such as https://ob*********.oss-cn-shanghai.aliyuncs.com/doc/img/odc/433/external%20table/employee.csv.

  2. In the SQL window of ODC, execute the following SQL statement to create a table named employee.

    CREATE EXTERNAL TABLE `employee` (
       `emp_no` int(120),
       `birthday` date,
       `name` varchar(120)
    )
       LOCATION = 'ob*********.oss-cn-shanghai.aliyuncs.com/doc/img/odc/433/500.sql-development/700.database-objects/100.web-odc-table-objects/employee/employee.csv'
       FORMAT = (
          TYPE = 'CSV'
          FIELD_DELIMITER = ','
          FIELD_OPTIONALLY_ENCLOSED_BY ='"'
          ENCODING = 'utf8mb4'
          )
       PATTERN = 'employee.csv';
    
    • The LOCATION option specifies the path where the external table is stored.

      • Local location format: LOCATION = '[file://] local_file_path'. If you use the Location format, you must set the system variable secure_file_priv to specify an accessible path. For more information, see secure_file_priv.

      • Remote location format: LOCATION = '{oss|cos|S3}://$ACCESS_ID:$ACCESS_KEY@$HOST/remote_file_path', where $ACCESS_ID, $ACCESS_KEY, and $HOST are required for accessing Alibaba Cloud OSS, Tencent Cloud Object Storage (COS), or Amazon Simple Storage Service (S3).

    • FORMAT = ( TYPE = 'CSV'... ) specifies the CSV format of the external file. The parameters are described as follows:

      • TYPE: the type of the external file.

      • LINE_DELIMITER: the line delimiter for the CSV file. The default value is LINE_DELIMITER='\n'.

      • FIELD_DELIMITER: the field delimiter for the CSV file. The default value is FIELD_DELIMITER='\t'.

      • ESCAPE: the escape character for the CSV file, which can be only 1 byte in length. The default value is ESCAPE ='\'.

      • FIELD_OPTIONALLY_ENCLOSED_BY: the characters that enclose the fields in the CSV file. By default, this parameter is left empty.

      • ENCODING: the character set encoding used by the file. For all character sets supported in MySQL compatible mode, see Character sets. If this parameter is not specified, the default value UTF8MB4 takes effect.

      • NULL_IF: the strings to be treated as NULL values. By default, this parameter is left empty.

      • SKIP_HEADER: specifies to skip the file header, and specifies the number of lines to skip.

      • SKIP_BLANK_LINES: specifies whether to skip blank lines. The default value is FALSE, which specifies not to skip blank lines.

      • TRIM_SPACE: specifies whether to remove leading and trailing spaces from fields in the file. The default value is FALSE, which specifies not to remove leading and trailing spaces from fields in the file.

      • EMPTY_FIELD_AS_NULL: specifies whether to treat empty strings as NULL values. The default value is FALSE, which specifies not to treat empty strings as NULL values.

    • The PATTERN option specifies a regular pattern string to filter files in the LOCATION directory. For each file in the directory specified by LOCATION, if the file path matches the pattern string, the external table accesses the file. Otherwise, the external table skips the file. By default, if this parameter is not specified, all files in the directory specified by LOCATION are accessible to the external table. The external table stores the list of files that match the LOCATION string specified by PATTERN in the system table of the database. During a scan, the external table accesses external files based on this list.

  3. In the left-side navigation pane, view the employee table in the external table list.

References

  • Create a view
  • Create a function
  • Create a stored procedure
  • Create a sequence
  • Create a program package
  • Create a trigger
  • Create a type
  • Create a synonym

Previous topic

Overview
Last

Next topic

Overview
Next
What is on this page
Background information
Logical table
Create an internal table
Create an external table
Procedure
Create an internal table
Create an external table
References