Hello Community. I am currently trying to import data from an oracle DB through OCI. ODBC is not an option.
A lot of my data are description text fields stored as "CLOB". For some reason when trying to run my sql query this runs EXTREMELY slow. After reading up on solutions, one was to add "CAST(TEXT AS VARCHAR(4000))" to the query to convert the clob to varchar, which returned the query to normal speeds. However a new problem arose.
Some of the fields contains more than 4000, which is the maximum allowed for varchar in the DB. Is there any way to bypass this?
Also, fields containing only 500 chars are being truncated.. any ideas?
Best Regards Simon.
Solved! Go to Solution.
Solution was found. Had to use Cast(Substr(Column_name,1,2000) as Varchar(4000)) and then add more substrings depending on lenght, and combine them afterwards. This fixed the slow handling of the clob, and gives me the full output of the field.