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

  1. #1

    Default Editing Queies

    Hi,

    Was wondering if there's a way to edit a table after you've created a query.
    Say you have something like

    <CFQUERY name="Test" DATASOURCE="#....#" username="#....#"
    password="#....#">
    SELECT aaaa, bbbb, cccc....
    FROM ....
    WHERE ....
    ORDER BY ....
    </CFQUERY>

    But now say I want to go through every record in "Test" and modify the aaaa's
    by performing some kind of function, like (aaaa + 5). And wherever I use this
    "Test", I will be using the new modified values. How do i do this? Can I use
    a <CFLOOP> and how do I set them, with a <CFSET>? Thank You.

    Chino

    ChinoTrixter Guest

  2. Similar Questions and Discussions

    1. Help With Editing
      I've been using Contribute 1.0 to edit our website forever. All of a sudden there are 3 or 4 pages out of the 500 page population of our website...
    2. editing text using advance editing feature
      I created 11 PDFs in InDesign for my client. She wants to be able to change the headlines on the PDFs using Acrobat editing features. I never...
    3. Editing .SWF
      I lost the .fla file and all I have is a .swf file of it, and I need to take some frames out of the animation, but I can't figure out how. If you...
    4. xml editing from within swf
      Basically, I am creating a website with about 10 pages. Each being a different section. Each of these pages will have a flash file with a block of...
    5. Help with editing?
      Hi, Thanks for any help. I need to make some changes to a section of my site that was made in fireworks MX. This section includes a pop up menu...
  3. #2

    Default Re: Editing Queies

    <CFQUERY ...>
    UPDATE table_name
    SET aaaa=aaaa+5
    </CFQUERY>

    aapacleb Guest

  4. #3

    Default Re: Editing Queies

    I don't think Chino wants to update the table, just the display

    <cfoutput query="Test">
    <cfset newValue = Test.aaaaa + 5>
    #newValue#
    </cfoutput>

    Ken
    The ScareCrow Guest

  5. #4

    Default Re: Editing Queies

    Yes I do want it for the display, but I was wondering if I can change all the
    aaaa values from "Test" at one go and have it stored in "Test" itself so that I
    dont have to modify the aaaa's wherever I have the <cfoutputs>.
    So I just want

    <cfoutput query="Test">
    #Test.aaaa#
    </cfoutput>

    but all the aaaa's have already been modified. Thank you.

    ChinoTrixter Guest

  6. #5

    Default Re: Editing Queies

    Did you try something like this...

    <cfloop query="Test">
    <cfset Test["aaaa"][currentRow] = aaaa + 5>
    </cfloop>

    <cfdump var="#Test#">
    mxstu 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