Professional Web Applications Themes

cfquery bug...still? - Coldfusion Server Administration

Hi, I have ColdFusion MX7,0,0,91690. I am trying to utilize the attached code. I am passing the query (it's easier for my implementation) in a variable. However, within the query variable is a single quoted string value used to pool the database (i.e. select * from table where somecolumn='this value'). In the error message, it shows that the cfquery tag has escaped the single quote on either side of the string with another single quote (i.e. select * from table where somecolumn=''this value''), thus causing an error in the query. I noticed that this was a bug with a hotfix ...

  1. #1

    Default cfquery bug...still?

    Hi, I have ColdFusion MX7,0,0,91690. I am trying to utilize the attached code.
    I am passing the query (it's easier for my implementation) in a variable.
    However, within the query variable is a single quoted string value used to pool
    the database (i.e. select * from table where somecolumn='this value'). In the
    error message, it shows that the cfquery tag has escaped the single quote on
    either side of the string with another single quote (i.e. select * from table
    where somecolumn=''this value''), thus causing an error in the query.

    I noticed that this was a bug with a hotfix in version 6.1. Was this not fixed
    in the later versions? Are they completely unrelated?

    Thanks in advance.
    jle

    code:

    <cfquery name="cinfo" datasource="database" dbtype="ODBC">
    #query#
    </cfquery>

    jlerath Guest

  2. #2

    Default Re: cfquery bug...still?

    Nevermind, I found the obvious solution right after I posed this message. Duh,
    so simple.

    jle


    <cfquery name="cinfo" datasource="database" dbtype="ODBC">
    #PreserveSingleQuotes(query)#
    </cfquery>

    jlerath Guest

  3. #3

    Default Re: cfquery bug...still?


    Thank you for posting your solution. This was driving me nuts!
    MCT Guest

Similar Threads

  1. CFQuery issue
    By colesc8 in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: September 9th, 03:47 PM
  2. cfquery
    By ducman in forum Macromedia ColdFusion
    Replies: 3
    Last Post: August 2nd, 07:09 AM
  3. Output from Cfquery
    By mike in forum Coldfusion Database Access
    Replies: 0
    Last Post: March 29th, 04:52 PM
  4. need help with cfquery
    By mkauspe in forum Coldfusion Database Access
    Replies: 3
    Last Post: March 24th, 11:11 PM
  5. CFQUERY with IF THEN ELSE
    By mike2004 in forum Coldfusion Database Access
    Replies: 10
    Last Post: March 4th, 03:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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