aspose file tools
The moose likes JDBC and the fly likes performing addition to a integer value using sql Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "performing addition to a integer value using sql" Watch "performing addition to a integer value using sql" New topic
Author

performing addition to a integer value using sql

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
Hi everyone,

I have an Int column in a table and I need to be able to add a number to the current value in the table. i.e. current value + value = new value

eg. 5 + 10 = 15

How do i this using sql.I have tried the following but it does not work

UPDATE Locations SET hitCount = hitCount + 1 WHERE locationId = 2;

Thank you
david
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1076

do you get any error message ?

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: performing addition to a integer value using sql
 
Similar Threads
Synchronizing Stateless Session Bean's member variable
DI and final filelds
How I run my web application on browser after deploying it on Websphere Application Server 6
problem in cookie
MySQL Date field , how to assign current date as default value ?