cfquery

Can I get a query row by index in ColdFusion?

会有一股神秘感。 提交于 2019-11-28 22:10:43
问题 I want to get a specific row in a ColdFusion Query object without looping over it. I'd like to do something like this: <cfquery name="QueryName" datasource="ds"> SELECT * FROM tablename </cfquery> <cfset x = QueryName[5]> But it's giving me an error saying that the query isn't indexable by "5". I know for a fact that there are more than 5 records in this query. 回答1: You can't get a row in CF <= 10. You have to get a specific column. <cfset x = QueryName.columnName[5]> It's been 8 years since

Variable as SQL in cfquery

徘徊边缘 提交于 2019-11-28 12:25:19
问题 I have a table that is storing SQL as one of its elements. I need to be able to run that stored SQL query, but can't figure out how to do it. So far, I'm using the following method: <cfquery name="qDynamicTag" datasource="#myDSN#"> #PreserveSingleQuotes(arguments.sql)# </cfquery> If I dump the value of #PreserveSingleQuotes(arguments.sql)# before executing the cfquery I see the correct SQL statement. However, when I try to run the above cfquery I get a SQLException with the message: Syntax

Retrieving long text (CLOB) using CFQuery

寵の児 提交于 2019-11-28 08:14:30
问题 I am using CFQuery to retrieve the CLOB field from Oracle DB. If the CLOB filed contains the Data less than ~ 8000, then I can see <CFQuery > retrieved the value ( <cfdump> the o/p), however If the value in CLOB field size is more than 8000 chars, then its not retrieving the value. in <cfdump> i can see the query retrieved as 'empty String' though the value exists in Oracle DB. I am using the Oracle Driver in CFadim console, enabled 'Enable long text retrieval (CLOB).' and 'Enable binary