Hi all

I have a bit of problem with a system which I can't get my head around and
wonder if anyone can do me a sanity check.
What I have is two tables arranged in header/detail fashion. The key field
between the two is a job number

Header table stru is for the sake of argument

Jobno
Product to be made
Qty required

Detail stru is

Jobno
Item number
Product to be issued
Qty to be issued
Child job


Child job refers to a sub assembly job. So to make a computer (assuming I'm
going to make a monitor!)

I have Job1, product is Computer, Qty 1
The details for this job are
J1, Item 1, Monitor,1 required, Child J4 which shows how to make a monitor
J1, Item 2, Keyboard, 1, No child job
J1, Item 3, Mouse, 1, No child job
J1, Item 4, Tower, 1, Child job J12

J4 Header has Monitor,1,
J4 Details has
J4, Item 1, Monitor Case, 1, no child
J4, Item 2, Buttons, 4, no child
J4, Item 3, TFT Panel, 1, no child

J12 header would then have Tower, 1
J12 details
J12, Item 1, Case, 1, no child
J12,Item 2, MB, 1 Child job J14

J14 would then drill down onto the motherboard and so on

With the application I can easily go 15 levels deep due to the way my
customer sets up how they build things

What I need to do is get this info into a cursor so I can populate a
treeview with it, I currently create cursor_level1 for the children in J1
and then create another cursor for J4 then another cursor for J12 which is
dog slow. I have complication that in my example above if the customer needs
two computers then all qtys underneath must be multiplied by 2. However if
it is one computer with 2 monitors then I'll need 2 monitor cases and 8
buttons. This quantity ripples all the way down 15 levels or however many.

Could anyone assist with an SQL statement to show the hierachy in a cursor.

Cheers
Graham




Graham Brown
CompSYS Software Solutions

Telephone: 0870 753 8480
General fax: 0870 753 8490
Support fax: 0845 009 4480
Mobile: 07973 988939
email: [EMAIL PROTECTED]
web: http://www.compsys.co.uk
CompSYS is a member of the BNI (Business Network International). If you'd
like to know how the BNI could grow your business or would like to visit one
of the weekly meetings held throughout the area, please let me know.



IMPORTANT: This email (including all attachments) is confidential and may be
privileged. It may only be read, copied and used by the intended recipients.
If you are not the intended recipient, you should not disseminate,
distribute or copy this email. Please notify the sender immediately and
delete this email from your system.

The security and reliability of emails is not guaranteed. Verification
should be sought from a mailed or faxed copy. Whilst we operate anti-virus
programmes, emails can become infected after being transmitted. You should
therefore take full responsibility for virus checking.


--- StripMime Report -- processed MIME parts ---
multipart/related
  multipart/alternative
    text/plain (text body -- kept)
    text/html
  image/jpeg
---


_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to