Grabbing long text from SQL Database with ColdFusion, output truncated

被刻印的时光 ゝ 提交于 2019-12-23 16:06:32

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/9021508/grabbing-long-text-from-sql-database-with-coldfusion-output-truncated

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!