Problem with Dynamic Update Query

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

  1. #1

    Default Problem with Dynamic Update Query

    I am having a problem with a dynamic query I create a string which will be
    inserted into the Query tag

    <cfQuery>
    Update Table
    Set #MyVar#
    </cfQuery>

    the value of myvar is
    field1 = 'some text'

    but when the system errors it shows the value of myvar to be
    field1 = "some text"

    I am trying to update a SQL Server 7 database which seems to only accept
    string in ' (single Quotes).

    If you have an idea please lte me know

    safrican1 Guest

  2. Similar Questions and Discussions

    1. flash > php > mySQL update query problem
      Hi all! Bit of an urgent problem. I am trying to update a mySQL database via flash and PHP where two variables are supplied, a name and a contact...
    2. Dynamic Query
      I have this query and would like it to display different results. I have to display records for either today, yesterday, this week, last week, last...
    3. Dynamic Query Problem
      I am using CF 5 and would like to create a dynamic query on a table based on 4 form variables. For example, if only two out of the 4 form...
    4. Dynamic insert query problem.
      Why is not working? Thanks. <cffunction name="InsertRow" hint="Insert a row in the table" access="remote" returnType="query" > <cfargument...
    5. Dynamic SQL Query
      Hello All, My life long persuit of true dynamic queries continues, and as usual, I hit another snag. I am try to create a dynamic search page...
  3. #2

    Default Re: Problem with Dynamic Update Query

    One, if you want this to work at all, you will have to use the
    preservesinglequotes function in your query.

    Two, if you dump myvar right before your query, how many quotes are there?

    Originally posted by: safrican1
    I am having a problem with a dynamic query I create a string which will be
    inserted into the Query tag

    <cfQuery>
    Update Table
    Set #MyVar#
    </cfQuery>

    the value of myvar is
    field1 = 'some text'

    but when the system errors it shows the value of myvar to be
    field1 = "some text"

    I am trying to update a SQL Server 7 database which seems to only accept
    string in ' (single Quotes).

    If you have an idea please lte me know



    Dan Bracuk Guest

  4. #3

    Default Re: Problem with Dynamic Update Query

    many thanks, preservesinglequotes did work.

    There are a number of fields, I have a dynamic custom tag that will update all
    fields from a form. So each field is wrapped in a set of quotes and some of
    them may have quotes in them, eg <textarea> fields.

    safrican1 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