• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

How to use an Implicit Cursor and two nested Explicit Cursors?

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am trying to work out exactly what a cursor is .. is it sort of like, a little helper-guy who goes and gets things for you, one field at a time? or one record at a time?
Do I have to give him a name, "helpCursor" like an object, tell him to go find a field(or record?) and write something like
while(fileAccessed.hasMoreFiles)
{
System.out.println(helpCursor.currentValue);
}
i am not using java with oracle at the moment, i am just writing javanese pseudo code because that is all i know at the moment. )-]
what i am trying to do is use an implicit cursor to display customer info of Mary Smith
from CUSTOMER
and two nested explicit cursors to display the order information...
the first cursor gets
Order_Id and Order_Date
from CUST_ORDER
and the second, nested cursor gets
Item_Desc from ITEM
Item_Price from INVENTORY
Order_Quantity from Order_Line
and also what I can only assume to be a calculated field which is the subtotal of each item ordered (where she got multiple items)
and another calculated field at the bottom
Order_Total

i am rather at sea on this one at the moment, would appreciate some directives :-) on how to set up the cursors...
ps - there is of course a cust_id i can access and an item_id i can access, an order_id and inventory_id...
pps - i am wondering how a cursor would deal with a calculated value - should a create a stored method so it can call it with parameters to return that paticular value?
thanks very much in advance:_)
 
Jasper Vader
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in case i didn't mention i am trying to do all this in a PL/SQL program, to be saved as a .sql (stored procedure?) file.
thanks again in advance ... :-)
 
reply
    Bookmark Topic Watch Topic
  • New Topic