Oracle Open Cursers
We have an issue with reaching the amount of available open cursers, and believe that a contributing factor is mixing cfqueryparams with other variables. Something like this:
where field1 = #var1#
and field2 = <cfqueryparam value = "#var2#"
We believe that using cfqueryparam everywhere in the where clause that has a cf variable, we will reduce the number of cursers we have to open.
The question is, "What about the select clause?". We have some pages that use some logic before the query, to produce variable abc. Two possible values of abc are:
decode(dbtest_code,
'CSA','CYCIB',
'TACRO','FK5IB',
'MPAC', 'MPAIB',
'MYPA', 'MPAIB',
'SIROL', 'RAPAM',
'SIRIB', 'RAPAM',
'BICV','HCO3','BICA','HCO3','BICC','HCO3',
dbtest_code) as test_code,
or decode(dbtest_code,'INR','IN','INRA','IN','PTT','PT','APTT','PT',dbtest_code) as test_code,
This gets used in the query tag like this:
select
to_char(date_coll,'yyyy-mm-dd hh24:mi') as date_coll,
#PreserveSingleQuotes(abc)#
etc
We are considering changing to something like this:
<cfif listlen(combos) gt 0>
decode(dbtest_code, <cfqueryparam cfsqltype="cf_sql_char" value="#combos#" list="yes">, dbtest_code) as test_code
<cfelse>
dbtest_code test_code
</cfif>