Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datatype for a text field of unknown length stored in Oracle database

What is the preferred datatype of a text field where the length is unknown? The text field could be small or very large. For example, I'm collecting forum comments and will not know the length of a particular comment (field). What datatype is preferred?

like image 359
milesmiles55 Avatar asked Sep 15 '25 05:09

milesmiles55


1 Answers

BLOB or CLOB. Based on your description, I think CLOB (Character Large Object). Here is one place to look.

However, you should know in advance that while CLOBs are relatively easy to deal with, it may be more complicated than you planned. VARCHAR2s are often acceptable, if by "unknown" you mean less than 4000 bytes. And dealing with them is pretty simple and straight forward.

like image 177
MJB Avatar answered Sep 17 '25 20:09

MJB