Is there a data type in ANSI standard SQL for holding an arbitrarily large string?
sql
Solution
Standard SQL provides the CLOB (character large object) type for holding really large text objects. However, there are limits on what you can do with such objects, and maybe your DBMS doesn't support the type. There is also the BLOB (binary large object) type.
Large fields were standardized after the main DBMS already had their own, non-standard facilities, so there isn't as much coherency between the different systems as you'd like. You would need to define the systems of interest, or accept that whatever you choose will need changing when you move to a different DBMS (or, most likely, both). There might be a common subset between your systems of interest, but it is relatively unlikely.
Problem
For my own fun, I'm trying to write an SQL script for building a db that is as cross-RDBMS as possible. It would just create the database, its tables, and maybe populate it with some data. One table holds coding problems, and I was wondering what data type to use for the description of the problem. If I were using MySQL, I would just use a TEXT type, but I saw that this is not available in (ANSI) standard SQL. Is there a data type available for arbitrarily large text data that would be standard SQL and compatible with Postgres/MySQL/MSSQL? Or do I just have to use a really huge VARCHAR and hope it's big enough?