Bruno Mello
Bruno Mello

Reputation: 25

SQL Modify String for CLOB

I have a field in a table that is of the text type, however it has the size of 8000 characters, in the Oracle database it gives the problem, I saw that if I switch to CLOB it works, however I am not getting using the syntax ALTER TABLE "table" MODIFY LOB ("column")

I need both the query for oracle and mysql, but I'm not finding a syntax from MODIFY text to CLOB to mysql

Upvotes: 1

Views: 2206

Answers (1)

nbk
nbk

Reputation: 49375

MySQL doesn't have a data type CLOB it has TEXT

Data Type   
(CLOB)      

TINYTEXT        L + 1 bytes, where L < 2**8  (255)
TEXT            L + 2 bytes, where L < 2**16 (64 K)
MEDIUMTEXT      L + 3 bytes, where L < 2**24 (16 MB)
LONGTEXT        L + 4 bytes, where L < 2**32 (4 GB)

You didn't find anything because they are called differently and are differently see size

so MySQL

ALTER TABLE `mytqable` MODIFY `colmunname` LONGTEXT

But oracle itself has the data type CLOB

alter table mytable modify (blob_column clob); 

Upvotes: 3

Related Questions