• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sql problem

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


above is the code i'm using to select items from two tables

in the line item table there are 3 fiels - ORDER_NUMBER,PART_NUMBER + QTY!
for every order number there is a part number and quantity so i want to print out all the items associated with a certain order number
eg.
ORDER NUMBER 43567 has:
PART NUMBER QB-101, QTY 4
PART NUMBER QB-102, QTY 1

but when i want to print out these two part numbers it only prints out the first one. I've tried different things but i cant get more than one item to be printed out..Can anyone help?
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think here is your answer:

http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html

when you open your recordset r for the inner loop, you loose your recordset rs in the outer loop. The solution is having a second statement-object.

Always remember: The API is your very best friend !
 
Thomas Manthey
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should be Resultset instead of Recordset, since this is clearly not MS-territory...
[ December 16, 2004: Message edited by: Thomas Manthey ]
 
Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic