Problem updating unique mutiple records

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

  1. #1

    Default Problem updating unique mutiple records

    What I need to do:

    Create an output form where users can update/delete a particular entry in my
    database.

    For example:

    Entry 1
    TBL_GEOREF_ID: 834
    Values: xx

    ***Update Button 1***

    Entry 2
    TBL_GEOREF_ID: 835
    Values: xxx

    ***Update Button 2***

    I don't want to have a form where both entries are updated. I want the user to
    be able to update just entry 2, or just entry 1.

    I am not sure how to do this:

    At the moment


    My code:

    output form:

    <CFQUERY NAME="EditQueryInstreamWork" DATASOURCE="Instreamworks">
    select *
    FROM TBL_GEOREF, TBL_INSTREAM_WORK
    WHERE TBL_INSTREAM_WORK.TBL_PROJECT_INFO_ID=#TBL_PROJECT _INFO_ID#
    AND TBL_INSTREAM_WORK.TBL_GEOREF_ID=TBL_GEOREF.TBL_GEO REF_ID
    </CFQUERY>

    <cfloop query="EditQueryInstreamWork">
    <tr><td><font color="000080" size="3" face="Verdana">Reason for
    Work:</font></TD><td><font color="000080" size="3" face="Verdana">
    <INPUT NAME="REASON" SIZE="65" STYLE="COLOR:cc0000;"
    value="#EditQueryInstreamWork.WORK_REASON#"></font></td></tr>
    <INPUT TYPE="submit" STYLE="FONT-WEIGHT: bold; width: 150px; height: 25px;
    COLOR:
    333366 ; FONT-FAMILY: Verdana" value="Save Changes"

    onClick="parent.location='InStreamUpdate2.cfm?TBL_ GEOREF_ID=#EditQueryInstreamWo
    rk.TBL_GEOREF_ID#'">

    </CFOUTPUT>
    </cfloop>


    My update page:

    <CFQUERY DATASOURCE="InstreamWorks" NAME="InsertInstreamWork1">
    UPDATE TBL_INSTREAM_WORK
    SET WORK_REASON='#Form.REASON#',
    WHERE TBL_GEOREF_ID=#FORM.TBL_GEOREF_ID#
    </CFQUERY>

    I get the following error message on the update page:


    Syntax error (comma) in query expression 'TBL_GEOREF_ID=834,835'.



    Thanks for your help


    sviolet Guest

  2. Similar Questions and Discussions

    1. Problem inserting/updating records
      Hi I'm having trouble trying to insert/update the records in SQL Server. I have created a form based on two tables and created a select...
    2. Updating Multi records
      Is there any way to update muliple records in one database table in one go?
    3. One Form, Mutiple Inserts, Multiple Records
      I am attempting to create a form which allows multiple record inserts. This will be used to add classes by participant to a training database. The...
    4. Updating Multiple Records
      I have a table in a database that contains all my photos. The fields are like Name, SRC, GalleryName, DateAdded, SpecialStyle. The only one you may...
    5. Unique Records in asp
      Hi, How can I count only unique records in a recordset? (sql server 7.0). When I do a select query for an asp page, I may have more than 1...
  3. #2

    Default Re: Problem updating unique mutiple records

    As the error indicates, you have a comma in your update query that's causing
    the syntax error.

    <CFQUERY DATASOURCE="InstreamWorks" NAME="InsertInstreamWork1">
    UPDATE TBL_INSTREAM_WORK
    SET WORK_REASON='#Form.REASON#',
    WHERE TBL_GEOREF_ID=#FORM.TBL_GEOREF_ID#
    </CFQUERY>

    get rid of the comma after: WORK_REASON='#Form.REASON#'

    BSterner 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