Query Of Queries runtime error in CFMX 7

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Query Of Queries runtime error in CFMX 7

    Hi,

    I am migrating from CF 5 to MX 7. All the queries are working fine in the old
    version. However when I try the same code in MX7 I get errors. An example is
    posted below.

    Error Occurred While Processing Request
    Query Of Queries runtime error.
    Comparison Exception: While executing "<>"
    Unsupported Type Comparison Exception: Comparator operator "<>" does not
    support comparison between following types:
    Left hand side expression type = "INTEGER".
    Right hand side expression type = "STRING".




    singhpk Guest

  2. Similar Questions and Discussions

    1. Query Of Queries runtime error. Unsupported typecomparison.
      Hello, I have very simple code which runs a query of all records in a table t_attributes. Just below this querie, I run a Query of Queryies on...
    2. Query Of Queries syntax error
      Hello I am running a Query of Queries and I'm getting the following error: Query Of Queries syntax error. Encountered "Section" at line 0, column...
    3. Query of queries Error
      I am putting query results into a new query to sort them, rather than using arrays. I can insert into a new query using queryNew just fine and even...
    4. Query of Queries on query New type query
      In CF5 we have a page that creates a query, using queryNew and querySetCell and the like, we then used dbtype="query" and gave it's name so we could...
    5. Query of Queries runtime error
      this also happened to me, on a different account. For me it happened on ORDER BY #url.o# #url.s# I have a <cfparam name='url.o'...
  3. #2

    Default Re: Query Of Queries runtime error in CFMX 7

    You may need to CAST() one or both of the selected columns to the appropriate
    matching data type in the original query before attempting to compare them
    within a Q-of-Q. CF 5 (and 4.5) seemed to be much more tolerant of implicit
    type conversion within queries than is CF 6 or 7. I'm sure that it is the price
    we pay for JDBC.

    Phil

    paross1 Guest

  4. #3

    Default Re: Query Of Queries runtime error in CFMX 7

    I have used CAST operator and now the whole query fails. I have no clue what's happening. It is working perfectly fine in CF 5.
    singhpk Guest

  5. #4

    Default Re: Query Of Queries runtime error in CFMX 7

    How about supplying a sample of your query and Q-of-Q? Perhaps someone will be able to spot where you may be going wrong.

    Phil
    paross1 Guest

  6. #5

    Default Re: Query Of Queries runtime error in CFMX 7

    Here is the attachment

    The initial query is called getModulelayout and is as follows

    SELECT
    a.surveyID,
    a.moduleName,
    a.moduleID,
    a.moduleSort,
    a.questionID,
    a.questionType,
    a.questionName,
    a.QuestionText,
    a.across,
    a.gridID,
    a.sortby,
    a.columnID,
    a.cType,
    a.cName,
    a.cText,
    a.cacross,
    a.cgridID,
    a.csortby,
    a.displayModeID,
    a.cdisplayModeID,
    a.questionTypeName,
    a.columnTypeName,
    h.helptext,
    h2.helptext as chelptext,
    o.optionText,
    o.optionID,
    v.variableTypeId,
    vt.shortName as variableTypeName,
    vt.decimalPlaces,
    v.minVal,
    v.maxVal,
    v.maxChange,
    v.notNull,
    vt.isNumeric,
    c2.cycleid,

    case a.variableid
    when -2 then null
    else a.variableID
    end as variableID,
    ISNULL(a.iscalculated,0) as iscalculated,
    a.factors,
    a.formula,
    a.delta,
    a.[isnumeric]
    FROM
    survey_view2 a
    INNER JOIN tblCycle c1
    ON c1.cycleid = 115
    AND c1.clientID = 5
    AND a.moduleID = 248
    LEFT JOIN tblOption o
    ON (a.optionSetID = o.optionSetID OR a.cOptionSetID=o.optionSetID)
    AND (a.questionType != 5 OR a.questionType IS NULL)
    AND 1 = 1
    LEFT JOIN tblCycle c2
    ON (c1.cycleSort=c2.cycleSort-a.delta and c2.clientID = 5)
    LEFT JOIN tblhelp h ON h.helpid=a.helpid
    LEFT JOIN tblhelp h2 ON h2.helpid=a.chelpid
    LEFT JOIN tblVariable v
    ON a.variableId=v.variableId
    left join tblVariableType vt
    ON v.variableTypeID = vt.variableTypeID

    WHERE isnull(a.displayModeID,1) in (1,2) AND isnull(a.cdisplayModeID,1) in
    (1,2)
    ORDER BY a.moduleSort, a.moduleID, a.sortBy, a.csortby, o.sortBy, o.optionID,
    a.questionName
    ---------------------------------------------------------------------

    Another query called "getCyclesForComparison"

    <cfquery name="getCyclesForComparison" datasource="#app_datasource#"
    cachedWithin="#twoHours#">
    select thisCycle.cycleID, isNull(lastCycle.cycleID, 0) as lastCycleID
    from tblCycle thisCycle
    left join tblCycle lastCycle
    on lastCycle.clientID = #app_clientID#
    and lastCycle.cycleSort = (
    select max(cycleSort)
    from tblCycle
    where cycleSort < thisCycle.cycleSort
    )
    where thisCycle.clientID = #app_clientID#
    order by thisCycle.cycleID
    </cfquery>

    ------------------------------------------------------------------------------
    Finally I am querying the above two queries using the following query
    <cfquery name="getVariables" dbtype="query" cachedWithin="#twoHours#">
    select getModuleLayout.variableID as variableID,
    cycleID
    from getModuleLayout
    where variableID <> ''
    <cfif getWholeSurvey>
    and surveyID = #surveyID#
    <cfif isdefined("moduleList") and len(moduleList)>
    and moduleID in (#moduleList#)
    </cfif>
    <cfelse>
    and moduleID = #moduleID#
    </cfif>
    and #cycleID# = #cycleID#

    union

    select getModuleLayout.variableID as variableID,
    getCyclesForComparison.lastCycleID as cycleID
    from getModuleLayout, getCyclesForComparison
    where getModuleLayout.variableID <> ''
    and getModuleLayout.maxChange <> ''
    and getCyclesForComparison.cycleID = getModuleLayout.cycleID
    <cfif getWholeSurvey>
    and getModuleLayout.surveyID = #surveyID#
    <cfif isdefined("moduleList") and len(moduleList)>
    and getModuleLayout.moduleID in (#moduleList#)
    </cfif>
    <cfelse>
    and getModuleLayout.moduleID = #moduleID#
    </cfif>
    and #cycleID# = #NumberFormat(cycleID)#

    order by cycleID, variableID
    </cfquery>

    singhpk Guest

  7. #6

    Default Re: Query Of Queries runtime error in CFMX 7

    I suspect that you are getting your error on the statements like variableID <>
    '' in your Q-of-Q, especially if variableID is numberic. You probably should
    write it as variableID IS NOT NULL instead of variableID <> ''.

    Try that with any of the lines where you are using var <> '' where var is a
    numeric data type in your original query.

    Phil

    paross1 Guest

  8. #7

    Default Re: Query Of Queries runtime error in CFMX 7

    It worked. Thanks a lot. :gift;
    singhpk Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139