I know it is probably a very bad idea to use a CLOB as a key, but I do need to use large text as a key on a one-shot operation.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
The simple version would be to generate a hash from the CLOB and use this as a key. This key will fit into the allowed key width for your engine (900 SQL Server, 767 InnoDB, 1000 MyISAM etc).
The hash can be generated by the engine as a computed column, trigger, or by some ETL process, or by the application
There is a faint chance of collision (birthday problem) but this would only matter for many records and poor choice of hashing algorithm