Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grabbing long text from SQL Database with ColdFusion, output truncated

Tags:

sql

coldfusion

I have a SQL database with a ntext field which holds page content.

I am using ColdFusion to query the information and deliver it to a form.

The form utilises ckeditor for this particular field, the field at present contains around 4000 characters. When looking in the ckeditor window it appears some of the text is missing.

However, when I look at the database data the text is not truncated at all; it is completely intact.

I thought this might be a character limitation with ckeditor, so I turned it off and viewed the data through a textarea box but the text is still missing.

The query is a simple select query held within a component, nothing special:

<cfquery name="getDrilledContent" datasource="#application.dsn#">
        SELECT co.uid_content, co.txt_contentgroup, co.txt_contentRefID, co.uid_contentuser, co.txt_contentvalue, co.dte_contentdate, co.txt_contentpagename,
        co.txt_metatitle, co.txt_metadescrip, co.txt_metakeywords, co.txt_metaurl, co.bit_primary, co.txt_h1, co.txt_contenturl, co.txt_contentlink,
        us.txt_du_firstname, us.txt_du_surname, txt_du_email, dte_edited, uid_changedby
        FROM tbl_content co 
        INNER JOIN tbl_datausers us ON co.uid_contentuser=us.uid_datauser
        WHERE uid_contentwebid = <cfqueryparam cfsqltype="cf_sql_integer" value="#session.webid#">
        <cfif Isdefined('arguments.uid_content') AND arguments.uid_content NEQ "">
        AND co.uid_content=<cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.uid_content#"></cfif>
</cfquery>

Why isn't this query pulling all the data down?

like image 949
Jason Congerton Avatar asked Nov 15 '25 11:11

Jason Congerton


1 Answers

Not to worry I've worked it out! It was a ColdFusion Administrator setting.

Under Data & Services -> Datasources, edit the datasource, and click the Show Advanced Settings button. This reveals additional options, one of which is CLOB - Enable long text retrieval.

I checked the check box, and the problem was resolved.

like image 52
Jason Congerton Avatar answered Nov 18 '25 19:11

Jason Congerton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!