Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Possible use of a Cursor

Possible use of a Cursor

From: Paul Izzo <paul.izzo_at_mosca-ag.com>
Date: 22 Feb 2005 22:54:40 -0800
Message-ID: <1109141680.605718.200070@f14g2000cwb.googlegroups.com>


I have a complex query that I hope I can explain it well enough for everyone to understand.

  I have a table that contains information for work instructions. Contained in the table are "MACHINE_PROC" these are groupings of machining processes (milling,drilling etc). Contained also in the table are "INSTRUCTION" that are a grouping of machining processes in a particular order. In order to organize the order "MACHINE_PROC" are made they become a "POSITION_NR".

  "INSTRUCTION" can have any number of "POSITION_NR" and
"MACHINE_PROC". "POSITION_NR" are always acending meaning that the
smallest number is at the begining of a instruction and the larger a number towards the end.

  The problem that I have is that I want to look for a given set of machining processes (MACHINE_PROC) from groups 3500, 3400 and 3430 in the first position of a given INSTRUCTION. The problem is that the first step of a INSTRUCTION doesn't always have the same number.

  Normally the first "POSITION_NR" of a job is "10" and the second "20" and so on... Room is left between the steps in case that a extra step needs to be added.

  If a step needs to be added before the first step it will get a number below "10" and if a step needs to be added between the first and second step it will be between "10" and "20" and so on...

  Hopefully you understand me in what I'm trying to explain. Here's 2 examples to help along.

  Remember I'm looking for the first step in an "INSTRUCTION" that has
"MACHINE_PROC" 3600, 3400 or 3430

Example 1

  INSTRUCTION_NR | MACHINE_PROC | POSITION_NR
     123456      |   3600       |    10
     123456      |   5600       |    20
     123456      |   4587       |    30

Example 2

   INSTRUCTION_NR | MACHINE_PROC | POSITION_NR
      456789      |    3600      |     5
      456789      |    6522      |     10
      456789      |    7841      |     20

  Does any one know how to go about this do I need to write a cursor of can I do this by using a couple select statements.

  P.S. This is not homework. This is a real problem that I have. I took the time to write this post, please don't respond to it saying it's homework or that I should read the manual. Received on Wed Feb 23 2005 - 00:54:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US