Help with updating in SQL

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

  1. #1

    Default Help with updating in SQL

    below is my query:

    <cfquery name="CreateMyProfile" datasource="Dating">
    Update MemberMain
    Set MyProfile = '1', ScreenName = '#Form.ScreenName#', Sex = '#Form.Sex#',
    Marital = '#Form.Marital#', LivingCountry = '#Form.LivingCountry#', Email =
    '#Form.Email#', PersoanlTitle = '#Form.PersonalTitle#', PersonalDesc =
    '#Form.PersonalDesc#', Height = '#Form.Height#', Weight = '#Form.Height#',
    Smoking = '#Form.Smoking#', Drinking = '#Form.Drinking#', Education =
    '#Form.Education#', MyRelationShip = '#Form.Relationship#', RelationShip1 =
    '#Form.Relationship2#', RelationShip3 = '#Form.Relationship3#' , RelationShip4
    = '#Form.Relationship4#', LookingFor = '#Form.LookingFor#', LookingForStartAge
    = '#Form.LookingForStartAge#', LookingForEndAge = '#Form.LookingForEndAge#',
    LookingForMarital = '#Form.LookingForMarital#', LookingForMarital1 =
    '#Form.LookingForMarital1#', LookingForMarital2 = '#Form.LookingForMarital2#',
    LookingForMarital3 = '#Form.LookingForMarital3#', LookingForRelationship =
    '#Form.LookingForRelationship#', LookingForRelationship1 =
    '#Form.LookingForRelationship1#', LookingForRelationship2 =
    '#Form.LookingForRelationship2#', LookingForRelationship3 =
    '#Form.LookingForRelationship3#', LookingForRelationship4 =
    '#Form.LookingForRelationship4#', LookingForEducation =
    '#Form.LookingForEducation#', LookingForEducation1 =
    '#Form.LookingForEducation1#', LookingForEducation2 =
    '#Form.LookingForEducation2#', LookingForEducation3 =
    '#Form.LookingForEducation3#', LookingForEducation4 =
    '#Form.LookingForEducation4#' where MemberID = '#Session.MemberID#'
    </cfquery>


    but it come out with error like that:


    The error occurred in D:\Inetpub\wwwroot\createprofile2.cfm: line 248
    Called from D:\Inetpub\wwwroot\createprofile2.cfm: line 1
    Called from D:\Inetpub\wwwroot\createprofile2.cfm: line 248
    Called from D:\Inetpub\wwwroot\createprofile2.cfm: line 1

    246 : <cfquery name="CreateMyProfile" datasource="Dating">
    247 : Update MemberMain
    248 : Set MyProfile = '1', ScreenName = '#Form.ScreenName#', Sex =
    '#Form.Sex#', Marital = '#Form.Marital#', LivingCountry =
    '#Form.LivingCountry#', Email = '#Form.Email#', PersoanlTitle =
    '#Form.PersonalTitle#', PersonalDesc = '#Form.PersonalDesc#', Height =
    '#Form.Height#', Weight = '#Form.Height#', Smoking = '#Form.Smoking#', Drinking
    = '#Form.Drinking#', Education = '#Form.Education#', MyRelationShip =
    '#Form.Relationship#', RelationShip1 = '#Form.Relationship2#', RelationShip3 =
    '#Form.Relationship3#' , RelationShip4 = '#Form.Relationship4#', LookingFor =
    '#Form.LookingFor#', LookingForStartAge = '#Form.LookingForStartAge#',
    LookingForEndAge = '#Form.LookingForEndAge#', LookingForMarital =
    '#Form.LookingForMarital#', LookingForMarital1 = '#Form.LookingForMarital1#',
    LookingForMarital2 = '#Form.LookingForMarital2#', LookingForMarital3 =
    '#Form.LookingForMarital3#', LookingForRelationship =
    '#Form.LookingForRelationship#', LookingForRelationship1 =
    '#Form.LookingForRelationship1#', LookingForRelationship2 =
    '#Form.LookingForRelationship2#', LookingForRelationship3 =
    '#Form.LookingForRelationship3#', LookingForRelationship4 =
    '#Form.LookingForRelationship4#', LookingForEducation =
    '#Form.LookingForEducation#', LookingForEducation1 =
    '#Form.LookingForEducation1#', LookingForEducation2 =
    '#Form.LookingForEducation2#', LookingForEducation3 =
    '#Form.LookingForEducation3#', LookingForEducation4 =
    '#Form.LookingForEducation4#' where MemberID = '#Session.MemberID#'
    249 : </cfquery>
    250 : <cflocation url="myprofile.cfm" addtoken="yes">



    --------------------------------------------------------------------------------

    SQL Update MemberMain Set MyProfile = '1', ScreenName = 'Sunny', Sex = '1',
    Marital = '3', LivingCountry = '2', Email = 'sunny722@gmail.com', PersoanlTitle
    = '', PersonalDesc = '', Height = '140', Weight = '140', Smoking = '0',
    Drinking = '0', Education = '1', MyRelationShip = 'true', RelationShip1 =
    'false', RelationShip3 = 'false' , RelationShip4 = 'false', LookingFor = '0',
    LookingForStartAge = '18', LookingForEndAge = '25', LookingForMarital = 'true',
    LookingForMarital1 = 'false', LookingForMarital2 = 'false', LookingForMarital3
    = 'false', LookingForRelationship = 'true', LookingForRelationship1 = 'false',
    LookingForRelationship2 = 'false', LookingForRelationship3 = 'false',
    LookingForRelationship4 = 'false', LookingForEducation = 'true',
    LookingForEducation1 = 'false', LookingForEducation2 = 'false',
    LookingForEducation3 = 'false', LookingForEducation4 = 'false' where MemberID =
    '1'
    DATASOURCE Dating
    VENDORERRORCODE 3088
    SQLSTATE &nbsp;

    can anybody tell me why?



    HongKongSunny Guest

  2. Similar Questions and Discussions

    1. Updating Updating site map or archive dynamically
      Hi there! ;-) Posted in Site Design as well.... Anyone know if there is a way to use Contribute to automatically/dynamically update a site map...
    2. Updating 3.0 to 3.1. Or not.
      What is an MSP file and how do I use it to update Contribute 3.0 to 3.1? The updater FAQ says just double click on the downloaded file but the...
    3. Updating
      So I've been asked to look into a design question for our company. We're looking toward building a web delivered product sometime down the road. ...
    4. Updating AI Files causes position to 'bounce' when updating in Quark
      Is there any way to build Illustrator files so that no matter what edit you might come back and make to the AI file, when you update the modified...
    5. XP updating
      The internet connection I have available is 28.8K max. There is no DSL, cable, or anyother type of high speed connection available for my...
  3. #2

    Default Re: Help with updating in SQL

    Just a guess, but you may be trying to insert a text value into a numeric
    field. For example, WHERE MemberID = '1': is MemberID really a text field?
    Also, it might be that 'false' should have the single quotes removed, depending
    upon how the fields are defined in the database.

    jdeline Guest

  4. #3

    Default Re: Help with updating in SQL

    Looks like you missed RelationShip2 (see in your code RelationShip1 = '#Form.Relationship2#'). Then if this is the case and RelationShip2 is NOT NULL field then it throw an error.
    CF_Oracle 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