本文介绍了使用ColdFusion从SQL数据库中获取长文本,输出被截断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 ntext 字段的SQL数据库,其中包含页面内容。

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

我正在使用ColdFusion来

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

该表单将ckeditor用于此特定字段,目前该字段包含大约4000个字符。在ckeditor窗口中查看时,似乎缺少一些文本。

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.

我认为这可能是ckeditor的字符限制,因此我将其关闭并通过textarea框查看了数据,但文本仍然丢失

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?

推荐答案

不用担心,我已经解决了!这是ColdFusion管理员设置。

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

Data&服务->数据源,编辑数据源,然后点击显示高级设置按钮。这显示了其他选项,其中之一是 CLOB-启用长文本检索

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.

这篇关于使用ColdFusion从SQL数据库中获取长文本,输出被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 19:23
查看更多