Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Buffer too small for CLOB to CHAR Oracle SQL query

GloriousWater
8 - Asteroid

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. 

Sicar_1-1587112758544.png

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. 

 

1 REPLY 1
GloriousWater
8 - Asteroid

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.  

Labels
Top Solution Authors