Skip to content

CLOB

CREATE TABLE test_table (
id INT NOT NULL AUTO_INCREMENT,
file_name VARCHAR(50) NOT NULL,
file_content TEXT,
PRIMARY KEY (id)
);
INSERT INTO test_table(file_name, file_content)
VALUES ('test_file', 'This is a test content for CLOB');
Query OK, 1 row affected (0.00 sec)
Query OK, 1 row affected (0.01 sec)

This example creates a test_table with a CLOB (Character Large Objects) field file_content and other fields like id and file_name. It then inserts a row into the table with test_file as the file name and ‘This is a test content for CLOB’ as the large text content. This serves as an example to handle and store large textual data in MySQL using CLOB.