PreserveSingleQuotes Not Working in CFQUERY

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default PreserveSingleQuotes Not Working in CFQUERY

    Just a heads up to those for those using CFSCRIPT within a CFQUERY to compose a
    Dynamic SQL statement. When you try to use PreserveSingleQuotes(SQLTEXT) the
    resulting query string is only partially escaped. The only Sucessfull approach
    I found was to compose the SQL using CFSCRIPT outside of the query, and then
    use PreserveSingleQuotes() within the CFQUERY block.

    Hopefully this might save someone else the headache.

    MrBoston Guest

  2. Similar Questions and Discussions

    1. 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...
    2. CFQUERY not working for some reason
      I have the following code to authenticate a password, and it is successful, complete the <CFIF> Statement: <cfquery name="checkpass"...
    3. PreserveSingleQuotes() problem
      Hi, I have a database in which some of the text in it has a single quote, mainly to show posession, such as " cat's ". Anyway, I can't get this...
    4. cfquery for date not working
      Greetings - I am sure what I am missing is something simple. I am trying to query for a specific date in a database. However, when I search for a...
    5. PreserveSingleQuotes and Evaluate
      Hi all. I've run into a bit of a problem with part of an application. I have users inputting , what can be, multiple animal (Species) names and...
  3. #2

    Default Re: PreserveSingleQuotes Not Working in CFQUERY

    What version of CF are you using?
    this is something we ran into. They broke the whole escaping thing with the
    6.1 updater, and now refuse to fix it.

    We actually store the SQL in our database and execute it later for logging
    purposes and what not. When we read the data back from the db and try and
    exceute in in a CFquery, it blows up because all of the single quotes, where
    they were 1 or 2 are replaced with 2

    david_h Guest

  4. #3

    Default Re: PreserveSingleQuotes Not Working in CFQUERY

    I'm using ColdFusion MX 7.
    MrBoston 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