0

I'm getting an error that I can't seem to shake. I've made hundreds of query of queries and can't seem to get this one working.

Main query:

<cfquery name="SpifCheck" datasource="MILESTONEBMDB">
  SELECT *
  FROM SPIF_list
</cfquery>

Loop with query of queries:

<cfloop query="orderLineItems">
  <cfquery name="SpifGrabber" dbtype="query">
    SELECT *
    FROM SpifCheck
    WHERE SKUprimary = <cfqueryparam value="#orderLineItems.qProdSku#" cfsqltype="cf_sql_clob" maxlength="255">
  </cfquery>
</cfloop>

Which is now throwing this error Error java.lang.UnsupportedOperationException: setCharacterStream()

Leigh
  • 28,765
  • 10
  • 55
  • 103
Charles L.
  • 1,844
  • 2
  • 34
  • 56
  • 1
    Is the datatype for `orderLineItems.qProdSku` really a clob? – Dan Bracuk Dec 12 '16 at 16:15
  • that normall works for me universally, however in this instance he demanded cf_sql_varchar – Charles L. Dec 12 '16 at 16:19
  • 2
    Laziness has it's place in programming, but this isn't it. Specify correct datatypes when using query parameters. – Dan Bracuk Dec 12 '16 at 16:21
  • This bug might be related to: http://stackoverflow.com/questions/8911120/change-to-a-new-oracle-jdbc-driver – James A Mohler Dec 12 '16 at 16:23
  • 2
    Do not follow the old Dreamweaver query wizard pattern which used cf_sql_clob for *everything* ;-) The cfsqltypes are not just arbitrary names. They determine how values are evaluated and [using the wrong type could produce the wrong results](http://stackoverflow.com/questions/27049918/coldfusion-parameterizing-a-query/27066113#27066113). Always use the correct type for the underlying column. Side note - querying within a loop usually scales poorly. Consider using JOIN's instead. – Leigh Dec 12 '16 at 18:48

1 Answers1

1

Corrected the issue, for some reason it really didn't like cf_sql_clob, changed it to cf_sql_varchar and woks perfectly now

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Charles L.
  • 1,844
  • 2
  • 34
  • 56