Reputation: 105
I have a MySQL database with a column datatyppe LONGTEXT. It has in the record 85.504 characters. When I do a select using coldfusion query, it only return the first 64,001 characters. Is ColdFusion limited to 64,001 characters?
selectTest = new query();
selectTest.setDatasource("myDB");
selectTest.setName("selectTest");
selectTest.addParam(name="MyID", value="#arguments.data.MyID#", cfsqltype="cf_sql_integer");
result = selectTest.execute(sql="SELECT MyLongText FROM MyTable WHERE ID = :MyID");
rs = result.getResult();
return rs.MyLongText[1];
This is my function where only return the first 64,001 characters.
Thanks
Upvotes: 4
Views: 1450
Reputation: 7833
ColdFusion uses JDBC drivers which buffer data retrieved from the SQL server. This buffer is limited to 64k bytes by default. If you need to retrieve larger data chunks, you have to increase the buffer.
Increasing the buffer can be done either by allowing full CLOB
/BLOB
retrieval (hint: LONGTEXT is considered as such) or by increasing the maximum amount of bytes in the buffer by manually setting a higher value.
Both things can be done in ColdFusion's datasource management (administrator panel).
Edit: The link posted by Ageax tells you the steps to enable full CLOB retrieval: Retrieving long text (CLOB) using CFQuery
Upvotes: 10