• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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 ]
 
I need a new interior decorator. This tiny ad just painted every room in my house purple.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic