Help with updating databse with cfloop

I want to move data from one column to another. I thought I could just query points2 column then use a cfloop to update the data to points1 column. Finally null out points2 column.
Below is my code on the first 2 steps. Unfortunately, I get the following error:
Syntax error in UPDATE statement.
The error occurred in wwwroot\forms\changepoints.cfm Line 18
<cfquery name="getPoints" datasource="#dsn2#">
SELECT leaderID, points2
from leaderboard
</cfquery>
<cfloop query="getPoints" startrow=1 >
  <CFQUERY NAME="DoUpdate" DATASOURCE="#dsn2#">
       UPDATE leaderboard
       SET points1=#getPoints.points2#
      WHERE leaderID=#getPoints.leaderID#    (line 18)
    </CFQUERY>
</cfloop>
What am I doing wrong?

Like Dan said before, I think you could replace this:
<!--- query to get all points --->
<cfquery name="getPoints" datasource="#dsn#">
SELECT leaderID, points2
from leaderboard
where (points2 IS not NULL) AND (tournID = 1)
</cfquery>
<!--- loop the points into the new column: points2 --->
<cfloop query="getPoints" startrow=1 >
  <CFQUERY NAME="DoUpdate" DATASOURCE="#dsn#">
       UPDATE leaderboard
       SET points1=#getPoints.points2#
       WHERE (leaderID=#getPoints.leaderID#) AND (tournID = 1)
    </CFQUERY>
</cfloop>
With this:
<cfquery name="updatePoints" datasource="#dsn#">
UPDATE leaderboard
SET points1=points2
WHERE (points2 IS NOT NULL) AND tournID =1
</cfquery>
Update queries run record by record, so you don't have to worry about it scrambling the values between rows (which you expressed as a concern in reply to Dan).  It's best to let the database handle this rather than by looping in ColdFusion - it will be much more efficient that way.
-Carl V.

Similar Messages

  • Help with opening Adobe Reader and downloading updates

    I can not open Adobe .pdf files any longer (this started yesterday, prior to that I could open adobe files).
    When I double click a .pdf file I get this notice on my screen: Windows cannot access the specified device path or file. You may not have the appropriate permission to access file.
    So I went to the Adobe download site to download a new copy of Adobe.  When I start the download I get this on the screen:  The instruction at "0x0e3a0068" referenced memory at "0x0e3a0068."  The memory could not be written.  Then two options are listed: click OK to terminate or cancel to debug.  So I click on cancel and I get this on my screen: Internet Explorer has closed this webpage to help protect your computer.   A malfunctioning or malicious addon has caused I.E. to close this webpage.
    I don't have AVG running, I do have avast but I've disabled it.  I ran Registry Mechanic and an I.E. erasure program but nothing helps.
    I have gone into I.E. and reduced the security level to its lowest state but no joy.
    So, any ideas or suggestions on what's the problem and how to overcome it would be appreciated.  Thanks, in advance, for your reply.  Jim R.

    Hi Mike..tried that as well but no joy.  A friend of mine was looking at it all and noticed that it was an I.E. thing as far as not letting me redownload the reader so I went to Mozilla Firefox and I could download a new version but....whenever I attempt to open a .pdf file I get that message, "Windows can not open the specified device, path or file. You man not have the appropriate permissions to access the item." 
    Damn...this is irritating as I need to get to some of thos files as I need them for a Journal I'm working on as editor-in-chief. 
    It all worked just fine last Saturday but starting Monday when I was on my flight out to D.C.  no joy. 
    Sigh...Jim R.
    Jim R.
    Date: Tue, 1 Dec 2009 14:50:27 -0700
    From: [email protected]
    To: [email protected]
    Subject: Help with opening Adobe Reader and downloading updates
    Under the help menu, there is an option to repair the installation of reader. Did you try that?
    >

  • Hello applecare  can you help with the macbook pro i did the update the last one and safari doesn't open anything .. what should i do ?

    hello applecare  can you help with the macbook pro i did the update the last one and safari doesn't open anything .. what should i do ?

    Hello John...
    You may have a Safari third party add on installed that was compatible with the previous version of Safari but not 5.1. Try troubleshooting > Safari: Unsupported third-party add-ons may cause Safari to unexpectedly quit or have performance issues
    FYI... this is a user to user forum. If you can't resolve the issue, information for contacting AppleCare  here.

  • My iPod touch was stolen and recovered.  I can use my Apple id for this site but the theif changed the Apple id needed to update apps etc and I do not know how to delete his acct. Any help with this will be greatly

    My iPod touch was stolen and recovered.  I can use my Apple id for this site but the theif changed the Apple id needed to update apps etc and I do not know how to delete his acct. Any help with this will be greatly appreciate

    If the thief enabled activation lock on the device, then there is nothing that can be done.  Only the password for the Apple ID that it is locked with can disable activation lock.

  • HT4061 need help with my iphone 4 i try to update last five  days but after updating to 6.1.2  it says that    We're sorry, we are unable to continue with your activation at this time. Please try again later, or c

    need help with my iphone 4 i try to update last five  days but after updating to 6.1.2  it says that
    We're sorry, we are unable to continue with your activation at this time. Please try again later, or c

    If the iPhone was hacked and unlocked via unofficial means, it has become locked again. Insert original SIM in the phone to activate with iTunes.

  • Since updating to FF 8 I can no longer use Multirow book marks, can anyone help with this issue?

    Since updating to FF 8 I can no longer use Multi-row book marks, can anyone help with this issue? the one I used is here http://multirowbookmarkstoolbar.com/

    Try the support site:
    *http://multirowbookmarkstoolbar.com/forum
    *Multirow Bookmarks Toolbar Plus: https://addons.mozilla.org/firefox/addon/multirow-bookmarks-toolbarplus/

  • MAC OS 10.6.8 Using Safari 5.1 Needing Help With Updating Adobe Flash

    Hello-
    Recently Adobe Flash installed an icon in my System Preferences and when I click the icon there are several tabs.  One allows updates to check automatically.  It says it will install the latest version of Flash without having to remove the previous version, but I have never been told that a newer version is available unless I clcik "check now."  although "Check for updates automatically" is checked, I do not know where it tells me a newer version is available.  Also, there has been 5 "newer versions" available since this icon was installed in System Prefeences, I have only found out about the newer versions when I clicked "Check Now."  If I read that with this new way to install the latest Mac version of Flash does not require me to uninstall the previous version of Flash how do I install the most recent version of Flash?  Does it come in an email?
    Since it is not telling me that there is a more recent version of Flash unless I click "Check Now" should I still do it the way I used to install the latest version of flash?  (The way before this icon was added to System Preferences)?
    I would appreciate help with updating Flash to the most recent version.  I used to uninstall the older version, restart the browser and download the most recent version and install it.  It always worked find but this was before there was an Adobe icon in my system Preferences.

    Hello,
    The way you used to do this (uninstall, restart the browser, etc.) is still definitely valid and probably the "safest" way to get a new version installed.  Uninstalling shouldn't be required, but it definitely doesn't hurt.  If you feel comfortable doing it the old way, please feel free to continue using that process.
    As for notifications, this is a bit trickier, but in general you should be notified within 30 days (or so) after a new player is released.  This usually occurs when the browser loads swf content.  Clicking the button will, like you mention, immediately check.  Another alternative to finding out when a new player is released is to subscribe to our Flash Player Releases feed.
    Is there a way to be automatically notified when a new Flash Runtime release is made?
    Thanks,
    Chris

  • Can anyone help with issue whereby Music, Podcasts and Audiable Book Apps keep stopping when listing via Headphones following IOS 7.01 Updates on Iphone 4?

    Can anyone help with issue whereby Music, Podcasts and Audiable Book Apps keep stopping when listing via Headphones following IOS 7.06 Updates on Iphone 4?
    I have tried the following all ready:
    Resetting Phone
    Resetting Settings on phone
    Change Headsets to speakers
    Reinstalled Phone
    Updated to IOS 7.1
    No of the above has resolved the issue does anyone have any ideas?

    Can anyone help with issue whereby Music, Podcasts and Audiable Book Apps keep stopping when listing via Headphones following IOS 7.06 Updates on Iphone 4?
    I have tried the following all ready:
    Resetting Phone
    Resetting Settings on phone
    Change Headsets to speakers
    Reinstalled Phone
    Updated to IOS 7.1
    No of the above has resolved the issue does anyone have any ideas?

  • Help with replicating/updating vendor master data

    Hi,
    Currently, we run the bbp_vendor_sync program to do the replication. It does the job of both bbpgetvd (new vendor creation) and bbpupdvd (update existing vendor).
    But the problem is, we have two number ranges for vendors. One is Numeric and other one is Alpha.
    Group -->AB     From 0010000000     to 0699999999
    Group -->AZ     From A     to ZZZZZZZZZZ
    The vendor synchronization program can consider only one number range at a time i.e.
    either Numeric or Alpha. So, we have to switch the active number range
    and run the program twice., first for numeric and then for alpha.
    In order to avoid this, I'm looking at implementing bbp_transdata_prep which I was told would take care of this issue.
    I looked around for documentation/sample code for bbp_transdata badi and couldnt find any on SAP help site or SDN.
    Wondering if someone can help with the documentation/sample code and difficuly level of implementing this BADI.
    Any help would be highly appreciated and suitable points would be awarded for your help.
    Also, if there is another way to solve this issue without implementing transdata badi, pls. let me know.
    TIA,
    Seyed

    Hi
    <u>Please go through this -></u>
    http://help.sap.com/saphelp_srm50/helpdata/en/56/54f137a5e6740ae10000009b38f8cf/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/62/fb7d3cb7f58910e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/42/d3b671ba67136fe10000000a1553f7/frameset.htm
    http://help.sap.com/saphelp_srm50/helpdata/en/bb/6c0e3b02616a42e10000000a11402f/frameset.htm
    <b><u>Sample BADI Implementation
    BADI Definition - BBP_TRANSDATA_PREP
    Purpose -> Impl. for BBP_TRANSDATA_PREP, Delete Invalid Mail Addresses</u></b>
    <u>PREPARE_REPLICATION_DATA method -></u>
    method IF_EX_BBP_TRANSDATA_PREP~PREPARE_REPLICATION_DATA.
      FIELD-SYMBOLS: <LFS_ADR6> TYPE ADR6.
      LOOP AT CT_ADR6 ASSIGNING <LFS_ADR6>.
        IF <LFS_ADR6>-SMTP_ADDR NS '@'.
          DELETE CT_ADR6.
        ENDIF.
      ENDLOOP.
    endmethod.
    <u>PREPARE_UPDATE_DATA method -></u>
    method IF_EX_BBP_TRANSDATA_PREP~PREPARE_UPDATE_DATA.
      FIELD-SYMBOLS: <LFS_ADR6> TYPE ADR6.
      LOOP AT CT_ADR6 ASSIGNING <LFS_ADR6>.
        IF <LFS_ADR6>-SMTP_ADDR NS '@'.
          DELETE CT_ADR6.
        ENDIF.
      ENDLOOP.
    endmethod.
    Hope this will help.
    Regards
    - Atul

  • I cannot download updates to Photoshop Elements 9.  I get an error message that my serial number is not recognized or eligible.  Can you help with this?

    I cannot download updates to Photoshop Elements 9.  I get an error message that my serial number is not recognized or eligible.  Can you help with this?

    Hi,
    Which operating system are you running on?
    What updates are you trying to download?
    The last update was 9.0.3 - check by loading the editor and going to Help -> About Photoshop Elements
    The last supported Camera raw is ACR 6.5 - check by loading the editor and going to Help -> About Plug-ins -> Camera Raw
    Do you have a reason to update?
    Brian

  • Can any one help with new iOS 7.1 update?

    Hello,
    I have recently downloaded the iOS 7.1 update and it has being causing problems with the iPhone 4s. The problems are as follows;
    No Wi-Fi connection all, and in full range of a connection (If and when I connect its for 10 seconds and gone again)
    Battery Life depleting quickly
    iPhone freezes constantly
    iPhone getting extremely hot when not in use.
    Is there anything that I can do that can help with this or will I have to wait for the next iOS update?
    Kieran

    If I restore as new without the backup & everything seems to be fine, I assume I would then have to restore it from my latest backup in iTunes in order to get all (or at least most) of my data back.
    From what I have read, it looks like at least the music I have on my iPhone 4S that I put there from a CD I own would not be in my backup.  That is not a major problem, since it is only 1 CD.
    It also seems like the iTunes backup is more complete than the iCloud backup (I do have both).
    So, I should probably be restoring from that backup.
    Is there anything else that is not backed up in an iTunes backup that I should consider before I do that?
    When I backup in iTunes (or even in iCloud), some items not backed up?
    Wouldn't I then have to re-install those items that are not in my backups?
    I have a Medical app from my local ambulance operator where I have taken a ton of time to input all of my medical information going back numerous years.  I just got tired of some medical person constantly asking me for information one never really makes a point of remembering.  Now, I have all of that information in my iPhone 4S.
    There is no way I would want to reinstall that app & re-input all of that information again.
    I also put a lot of "lists" in the Notes area on my iPhone 4S.
    I understand that is also something that is not backed up.
    These are just 2 examples.
    I also have other items that I am under the impression also are not backed up.
    Losing any of that information would be a huge burden to recover.
    I am willing to take a chance with some items that are not backed up to either iTunes nor iCloud.
    But, knowlingly doing something that may lose that information is not something I am willing to do.
    OR, am I just not understanding what is and is not backed up in iTunes or iCloud & what I could potentially lose?

  • Please help with error message while trying to update i tunes

    Errors occurred while installing the updates, if the problem persists, choose tools, download only and installing manually

    When i try and download i-tunes i get a message about URBCHN1 not being a win32 command, or something similar.
    ... that's an unusual one.
    could you possibly send us a screenshot of the error message box? for instructions, see the following user tip:
    hudgie: Taking screenshots to help with problems

  • Help with C6-00 photo update

    I need help with updating the items in the photo gallery. Anytime I transfer pictures from PC to the phone using either a USB connection or bluetooth, the items just stay in the memory card. What I mean is that they can only be acessed through file manager and not possible to veiw them using the Photo application. It is as if the Photo application does not automatically update itself. I have tried moving the items from one folder to another, even using the images folder itself. Please, can you tell me what to do about it?
    Usually, the same thing happens with Videos too.
    Thanks in advance.

    The apps wont recognise the photos or videos if file extension is missing.Go to file manager and locate your file.Check whether it contains file extension.If not rename the file with . Jpg extension.If you dont know the type of file, select options >details(it should be something like that) to know it.After renaming all your files in file manager close file manager and open yout photo app.It should show all your photos.Same goes for videos which you will need to rename to .mp4 or .3gp as the case may be.
    In Love With My C6-01:Now running on Nokia Belle!

  • Can anyone help with problem updating iphone5s cant get anything only apple on screen sometimes screen flashes blue

    can anyone help with problem updating iphone5s cant get anything only apple on screen sometimes screen flashes blue

    Hey damien555,
    Thanks for the question, I understand how frustrating this may be. It sounds like the update process may have been interrupted, and to resolve the issue, we’ll need to restore your device in recovery mode with iTunes:
    If you can't update or restore your iOS device
    http://support.apple.com/kb/HT1808
    Thanks,
    Matt M.

  • Please help! I am trying to change my Apple Id that used to be my mother to Mine- Every time i have it changed and i go and try and do an update it continues to ask for her old password. I really need help with this!

    Please help! I am trying to change my Apple Id that used to be my mother to Mine- Every time i have it changed and i go and try and do an update it continues to ask for her old password. I really need help with this!

    Phil0124 wrote:
    Apps downloaded with an Apple ID are forever tied to that Apple ID and will always require it to update.
    The only way around this is to delete the apps that require the other Apple ID and download them again with yours.
    Or simply log out of iTunes & App stores then log in with updated AppleID.

  • Help with CS5 Updates Failed, Updates could not be applied, Error Code U43M1D207

    CS5 Updates Failed, Updates could not be applied, Error Code U43M1D207
    Can anyone help with this error code?
    Products installed and activated on new laptop
    Unable to update using Adobe Application Manager
    Thank you

    I followed up on the Photoshop Error code and found some suggestions by Jeff Tranberry and Pete Green here.
    Michael

Maybe you are looking for