Updating a database value when you don't have the current value

I need to write a query that updates the amount of points a
user has, even though i don't know how many they have currently.
This is part of a referal program. When a user gets another user to
join, the original user gets 15 more points. The problem is I do
not want to write a query that finds how many points the original
user has because that seems wasteful. It should look something
like..
<cfquery datasource="users" name="givepoints">
Update users
set points = [whatever the current value is + 15]
where userlogin = form.referer
</cfquery>
That line that has the value in the brackets is where i am
confused. I don't know the current value so how can i add 15 to
it?

In some databases, oracle for example, the use of
cfqueryparam speeds up your queries. It also has the potential to
simplify your code in that it handles things like apostrophes, so
you don't have to.
On the other hand, if you want to cache your query, you can't
use cfqueryparam. Also, if you are using some sort of logic to
build an sql variable to use in your query, it takes a lot of
effort (more than I'm prepared to give) to use cfqueryparam.
Also, not every db supports it.
cfqueryparam has it's place, but that place is not
everywhere.

Similar Messages

  • Awesome Tip for editing a PDF when you don't have the fonts

    Needed to do this yesterday and looked online and found out how to edit a PDF file in Illustrator when you don't have the fonts. This is a godsend and thought others might benefit from it if they don't know about it.
    Problem: You get a PDF file from somebody and when you try to open it in Illustrator, the PDF is using fonts that you don't have so it substitutes the fonts and screws everything up.
    Solution: Create a new Illustrator document the size of the PDF.
    Place the PDF into the Illustrator document.
    While the PDF is selected, go to Object menu / Flatten Transparency
    In there, make sure"Convert All Test to Outlines" IS checked.
    Click OK and there you go, everything is converted to outlines, including the fonts and you can do with it what you want.
    Enjoy!

    It's an excellent tip. This can also be done within Acrobat: Flatten transparency with Convert Type to Outlines toggled on, then Save As a new PDF, then Embed-Place the new PDF in Illustrator. It's a functionally identical process, although yours is superior because it requires fewer steps.
    While Tom is right that you can't edit the text (because it isn't live), you certainly can, for example, include artwork from another party that would otherwise lose its typographic appearance.

  • Moving a library to a new computer when you don't have the old computer

    Hi,
    I want to set up my ipod library on a new computer but I don't have the old one. Is this possible?
    I used my work computer to set up my ipod mini and have since changed jobs. I only have the ipod and want to associate my new work computer with the library that exists on the ipod mini.
    I can't seem to find any information that deals with this situation. Any ideas/help?
    thanks!
    Mini   Windows XP  

    If you have any iTMS purchases the transfer of purchased content from the iPod to authorised computers has been introduced with iTunes 7. A paragraph on it has been added to this article: Transfer iTunes Store purchases using iPod
    The transfer of non iTMS content such as songs imported from CD is designed by default to be one way from iTunes to iPod. However there is a manual method of accessing the iPod's hard drive and copying songs back to iTunes on Windows posted in this thread: MacMuse - iPod to iTunes
    If you prefer something more automated then there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod, this is just a selection. Have a look at the web pages and documentation for these, they are generally quite straightforward. You can read reviews of some of them here: Wired News - Rescue Your Stranded Tunes
    YamiPod Mac and Windows Versions
    iGadget Windows Only
    iPod Access Mac and Windows Versions
    PodUtil Mac and Windows Versions
    iPodCopy Mac and Windows Versions
    PodPlayer Windows Only
    CopyPod Windows Only

  • How do I remove an old apple ID off an iPad when you don't have the original user's log in information?

    Hi, my company has recently started issuing techs iPhones and iPads. I have an iPad here we got back from an employee after termination. He gave me his 4 digit passcode to get into the iPad, I removed the passcode to unlock, and did a reset on the device. Turn it on, I get the "Hello" screen and the initial set up pages. I get to the page with  "input your Apple ID" and when I tried to enter a new ID, it wouldn't accept it because the device had already been associated with a different Apple ID. The prompt it gave was to log in online with the original Apple ID and remove the device. Well... can't do that since the employee is long gone and that's not going to happen. So what do I do here? How do I remove it to set up a new Apple ID?

    Without the ID/password, you won't be able to use it. Suggest you take it to an Apple store. They may have some advice.
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/
    Next time, they should  do this:
    What to do before selling or giving away your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/HT5661
    If the iPad was running iOS 7,  iCloud: Find My iPhone Activation Lock in iOS 7
    http://support.apple.com/kb/HT5818
    iCloud: Activation Lock
    http://support.apple.com/kb/PH13695
    Find My iPhone Activation Lock: Removing a device from a previous owner’s account
    http://support.apple.com/kb/ts4515
    Buying or Selling a Used iPhone or iPad Running iOS 7? Read This First!
    http://www.makeuseof.com/tag/buying-or-selling-a-used-iphone-running-ios-7-read- this-first/
     Cheers, Tom
    Message was edited by: Texas Mac Man

  • How to erase a Mac Pro for selling when you don't have the discs

    I have a Mac Pro 1,1 that I'd like to sell, so I need to remove all information from the HD, BUT none of the disc I have seem to work to install from.
    I have several Macs and so have a lot of discs.....but none of them will work when I restart holding down C, or Command + R.
    I have gone to Disc Utility and can't select the HD to erase, because it seems to be greyed out.
    I have on original discs:
    10.0
    10.4
    10.4.7
    10.5
    10.5.6
    10.6.3
    all discs I either got with Mac's or purchased...!
    What's the solution?
    All I want is to be able to sell the machine with some working OS on it?
    Thanks,
    Alan,

    Thanks Grant
    The 10.6.3 disc would be the best. You will need a wired keyboard plugged directly into a USB port on the chassis, not on a display or any Hub.
         I am using wired kb.
    If you hold down Alt/Option key at Startup, that should invoke the Startup Manager, and slowly draw an icon for each potentially bootable Volume. Choose the one you want and tell it to proceed.
         So, right after I hear the chime, I should hold down "option"? How long should this take? A few times the computer seemed to freeze when doing this, and I just held down the power button for 10 sec to start over (I had a grey screen for a few minutes)...other times, it seems to just bypass the whole option and just restart normally?
    Answer only the "what language" question and do not install. Wait for the menuBar to be drawn, then choose Disk Utility off a menu.
    Appreciate any other suggestions you may have, thanks,
    Alan.

  • How do you delete an itunes account when you don't have the password.

    My partner's itunes account was hacked. She cannot get into it.  Neither her id nor her password work.  Apple has said they will put a "hold" on the account, but this renders itunes useless and it seems you can't start a new (second) itunes account on the same iPad/iPhone/iPod.  How can you delete the itunes account altogether so that she can start a new one? 

    I assume you're using an iOS and not an OSX device here. If not, then let me know.
    Go to Settings>Scroll down to iTunes and App Stores>Click Apple ID>Click Sign Out
    Then, create a new account on the web and sign in
    I hope this works

  • Restoring iWeb files when you don't have the DOMAIN file for the folder

    Can anyone assist please.
    I have recently lost my hard drive in my iMac and have now replaced and recovered as much as I can.
    I have managed to recover all my iWeb files but can't get the domain file from the route of the iWeb directory back so every time I start iWeb it try's to create a new web site.
    Does anyone know how I can rebuild the Domain file ?
    Thanks in advance.

    Anthony Poole wrote:
    Does anyone know how I can rebuild the Domain file ?
    Tony ~ Welcome to the discussions. You'll have to rebuild it manually from scratch — see paragraph 2.3 of this FAQ page for some tips:
    http://iwebfaq.org/site/iWebBackupretrieve.html

  • Sync Your ipod to a New Computer when You Don't Have the Old One

    Hey
    No longer have access to my old computer - where i used to sync my ipod.
    now i have a new computer.
    it won't sync.
    why?
    please help
    thanks

    I asked apple care this once and they said you need to call for them to help you deauthorize and re authorize you new pc.
    I dont know if that would be it or not. You only get one free support call first ninty days I think unless you purchased apple care plan somewehre.

  • How to Transfer Files from Your Ipod to a New Computer when You Don't Have the Old One?

    My old computer crashed and I have a new one now, how do I transfer the files from my ipod to my new computer itunes program???

    I am having the same problem.  My iPod classic has all of the music on it and I need to get it into iTunes.  Unfortunately, I had not had the computer very long and it did crash before I was able to back anything up.

  • How to deauthorise when you don't have the device

    Hi, I seem to have five devices authorised on my account but at least 1 of these is an old laptop that I forgot to deauthorise. Is there anyway to address this as I cannot authorise my present laptop.

    Use the Deauthorize All command documented in this article.
    (100148)

  • How can you listen to music when you don't have an Internet or cellular connection?

    Is it possible to access your library and Match?

    Yes, just not all of it.
    As you play music from the cloud, it gets saved to your device so the next time you play it, you don't need to be connected to the internet. That's why there's a setting to "show all music" - if you turn that off, you'll just see the songs that you have with you already, and can play without internet access.
    You can also choose to download songs, albums or entire playlists, and those will be available later when you don't have a connection.

  • How to unlock a iphone4 when you don't have a itunes account

    how to unlock a ipone4 when you don't have a itunes account

    You don't unlock it without itunes.

  • HT1918 Answering security question when you don't know the answer

    Answer the security questions when you don' t know the answer I have done every thing you asked. I even have change my pass word three times when it not been needed

    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HE37
    My Apple ID
    https://appleid.apple.com

  • You don't have the privileges to create or run workbooks

    Hi Experts;
    I am using Oracle DB 10.2 , Discoverer version 10.1.2.0, EUL 5.1.1, EUL library 10.1.2.48.18
    I use Role based security in my applications i.e. I am granting privileges to the roles and then granting the roles to the users, but I am having a problem with one of the schema/EUL which I could not trace.
    I have granted the bussiness area to the role "B_User", I have also granted the following Desktop and Plus Privileges to the role "B_User"
    1) Create/Edit Query
    2) Collect Query statistics
    3) Item Drill
    4) Drill out
    5) Create Link
    The required workbooks are shared to the roles, but when I log on to Discoverer plus and try to open the workbook it gives the following error "You don't have the privileges to create or run workbooks. Please contact your Discoverer manager". I could create the workbooks but can't run any of the workbooks( existing or newly created).
    I followed the same method for granting Security and Privileges for other schemas/EUL and they are working fine.
    Is there anything wrong with the EUL I created? I even tried granting security access to "Public" and granted the Desktop and Plus privileges to "Public" for the stated EUL but still have the same problem.
    Any help would be highly appreciated.
    Thanks
    Jethoo

    Hey Jethoo.
    At first blush, what you've written looks fine to me (assuming all the correct grants, etc. work in other business areas in the EUL).
    So, let me just go over it.
    1. You granted security (not privs) on the business area to a role 'B_User'. That means that anyone going into Disco using that role will let them see the underlying data.
    2. You've granted privs to the role 'B_User' to be able to play with Disco. That looks fine.
    3. You've written workbooks that have been shared with the role 'B_User'. That means that the end user can run a workbook.
    So what I'd look at are:
    4. I assume you only have 1 EUL and if not, are pointing to the correct one (in Tools -> Options -> EUL.
    5. Did you create the workbooks in Disco Plus or Disco Desktop?
    6. Have you tried to run the same workbooks in Disco Desktop?
    7. When you did all the Admin stuff, did you reconnect in Disco Plus / Desktop before going on?
    8. Did you assign the role to the user - at the database level you're having problems with?
    9. Was it Friday the 13th. when you did all this - okay, maybe that's not an issue, but reaching here.
    Russ
    Message was edited by:
    russ_proudman

  • The operation can't be completed because you don't have the necessary permission.

    My wife and I share files on our home network all the time. the problem is when I create files on my Mac Pro or Macbook Pro (.doc, .tif, .jpg, .psd, .png, etc) and place them on her Mac Mini. she can not edit them. She gets the message: "The operation can’t be completed because you don’t have the necessary permission."
    The only way I know how to fix the problem is to delete the file from her Mac, change the permissions on my Mac (via Get Info), and then re-copy the file back to her computer. The problem is there are hundreds of files, in different folders on her Mac, so using a batch command with Get Info (Cmd, Option I) is not an option.
    First of all why are all the files I create "Read only" for "staff" and "everyone" in first place?
    Is the problem with my computer or with hers?
    Is there a way for her to overide the permissions so I dont have to spend days or weeks going through every file I have created on my Mac?
    Here is a screeen shot of one file:
    Here is a Screen shot of the Folder on her MacMini that I drop files into:

    She needs to connect to the file server with your name and password. Then she'll have the same access you have. I assume that's what you want.

Maybe you are looking for

  • S-ATA Hard Drive on 865PE NEo-2 FIS2r M/B

    I've recently bought several components (which I'll list below) and am having a bit of trouble connecting the HDD and configuring the BIOS to recognise it. I'm new to building computers, so please forgive my 'newbieness'. The main components are: M/B

  • Copying data to another database after little transformation

    Hi, Is there any better pattern for copying data from one database to another database after some little transformation(can be simple SQL join). I see couple of options like.. 1. Using materialized views 2. Writing a simple procedure to do copy and t

  • I need help on this schematic

    I am having trouble trying to figure out this design that is being used for a simple indication that a weight is being applied to a peice of equipment. the actual pcb that I have to go off of does not give a good view of where or how it is wired.  I

  • I beat the Beachballs.....but.....

    Immediately after booting into Mountain Lion for the first time, I began having problems.  My MacBook Pro was crippled. Stalls. Freezes. Hangs. And tons of spinning beach balls. A finder window could take more than a minute to open. Switching between

  • Acrobat Pro 11.0.08: Why are all of my PDF files (hundreds) now images?

    Search, editing, OCR does not work.  I have v-11 at home and it works fine. Burko77