• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

selecting a particular record from a derby table

 
Rancher
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a table with a first column as ID (integer) and this column is the primary key

I do some calculations to decide which record I wish to retrieve
and end up with the following integer value variable called Candidate_ID

The table also has a column called Occurances (integer) which I wish to update by adding 1


I am getting an error on the first line of code
SQL State: 42X04
Error Code: 20000
Message: Column 'Candidate_ID' is either not in any table or................

What should I change in the first line ?

Bob M
 
Sheriff
Posts: 26791
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bob Matthews wrote:and end up with the following integer value variable called Candidate_ID



If "Candidate_ID" is a variable in your Java code then you should change line 1 to a group of lines which use a PreparedStatement.

You already know how to do that because you've done it in lines 6, 8, and 9.
 
Bob Matthews
Rancher
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Paul

Bob M
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic