Oracle INSERT SELECT,具有coldfusion cfqueryparam BLOB类型
让我们简单一点,希望你们能帮助和理解Oracle INSERT SELECT,具有coldfusion cfqueryparam BLOB类型,oracle,coldfusion,Oracle,Coldfusion,让我们简单一点,希望你们能帮助和理解 <cfsavecontent variable="sContent"> <cfoutput> here i will have alot of Text will needed to INSERT SELECT into database </cfoutput> <cfsavecontent> <!--- perform insert select ---> &
<cfsavecontent variable="sContent">
<cfoutput>
here i will have alot of Text will needed to INSERT SELECT into database
</cfoutput>
<cfsavecontent>
<!--- perform insert select --->
<cfquery name="Inserting" datasource="#data#">
insert table1 (content)
select <cfqueryparam value = "#sContent#" CFSQLType = "CF_SQL_BLOB">
from dual
</cfquery>
之所以使用blob,是因为我插入数据库的内容包含大量文本。
这是插入blob数据的正确方法吗?为什么尝试使用cfqueryparam从数据库表本身进行插入?insert table1 content select SCOContent from dual足够正确吗?SCOContent超过4000个字符,DDL语句出现了一个关于无法绑定长的错误。为什么要将blob用于文本数据?您可以使用CLOB,因为它适用于大量文本。原因使用插入选择,因为要消除cfloop插入到性能问题可以使用插入选择方法吗?我需要它只是因为一些原因。知道另一个原因会有帮助-你真的在做选择。。。从DUAL还是从实际表格中选择?
<cfquery name="Inserting" datasource="#data#">
INSERT INTO table1 (
content
) VALUES (
<cfqueryparam value = "#sContent#" CFSQLType = "CF_SQL_BLOB" />
)
</cfquery>
insertBlob = new Query( sql = "INSERT INTO table1 ( content ) VALUES ( :content )", datasource = data );
insertBlob.addParam( name = "content", value = sContent, cfsqltype = "CF_SQL_BLOB" );
insertBlob.execute();