How to take count

sreekuax

Member
Hi ,

I am using QAD mfg/pro eB2 with Oracle database.
I have to do a data extarct from isb_mstr table.
I am stuck in one field extraction.

I need to take a count and put inside the field in data extract file with label
"# of Users" .
Condition /rule of getting this count is :

where isb_part = 'SEATS' and isb_inv_nbr of parent item = isb_inv_nbr of child item and isb_so_line of parent item = isb_so_line of child item.
We are knowing that ceratain isb_part values are parent item as isb_parent = yes.. if isb_parent = no then that is child item.


Please give me a logic in progress 4gl to implement this....
Also if sql query can be used inside progress, please mention that also and how to use that inside progress program..

Please help.. its urgent...

Thanks in advance
Kumar
 
psuedo code.

define buffer isbchild
Go thru isb_mstr where isb_parent = yes
look in the buffer for child
Export.

You cannot have sql in 4gl code it has to 4gl only.
 

sreekuax

Member
psuedo code.

define buffer isbchild
Go thru isb_mstr where isb_parent = yes
look in the buffer for child
Export.

You cannot have sql in 4gl code it has to 4gl only.

Hi Kishor,

Thanks for the reply...

I understood defining the buffer..but what you meant by going through the
isb_mstr... also how to verify the isb_inv_nbr of parent item = isb_inv_nbr of child item and isb_so_line of parent item = isb_so_line of child item.
Please clarify...

I tried using temptables.. but I am not getting that properly.. :-(
 

DivyaRajesh

New Member
in case ure looking only for the parent - child relationship....why dont you use ib_det ..... instead of defining a buffer!!!
 

sreekuax

Member
in case ure looking only for the parent - child relationship....why dont you use ib_det ..... instead of defining a buffer!!!

That seems to be an idea...
But How can i get the count with the criteria that I have mentioned..
i.e what are the corresponding fileds inside ib_det for isb_mstr.. ?
 

DivyaRajesh

New Member
isb_part = ib_sys_part
isb_serial = ib_sys_serial
isb_parent = yes
isb_eu_nbr = ib_eu_nbr
isb_ref = ib_sys_ref.....


once u get this.... u can get all the count!!!!
 

sreekuax

Member
isb_part = ib_sys_part
isb_serial = ib_sys_serial
isb_parent = yes
isb_eu_nbr = ib_eu_nbr
isb_ref = ib_sys_ref.....


once u get this.... u can get all the count!!!!


Thanks for the reply...
but here i am again confused...
what my need is : to get a count of records which is having
isb_part = 'SEATS'
isb_so_line of parent item = isb_so_line of child
isb_inv_nbr of parent item = isb_inv_nbr of child.
fo eg :
isb_part = 0MINPENWU1000N which is having isb_parent = yes..which means it is parent..so it will have child items under that and child value are
isb_part = NODELOCKED
PKGNG4252
SEATS
SEATS
SEATS
SEATS
SEATS
SEATS
SEATS.

Now lets take isb_so_line and isb_inv_nbr for parent item
isb_part isb_so_line isb_inv_nbr
0MINPENWU1000N 1 IN272128

Now lets take isb_so_line and isb_inv_nbr for child items

isb_part isb_so_line isb_inv_nbr

NODELOCKED 2 IN272125
PKGNG4252 4 IN272156
SEATS 2 IN272128
SEATS 1 IN272128
SEATS 1 IN272128

Now go back to our condition for getting count
isb_part = SEATS
isb_so_line of parent item = isb_so_line of child
isb_inv_nbr of parent item = isb_inv_nbr of child.

By cross referencing the above data you will come to know there are two values with part value = SEATS , which is child and have the saem value of so_line and inv_nbr of its parent item which is = 0MINPENWU1000N
So count = 2

Now HOW TO GET THIS COUNT PROGRAMMATICALLY... ?
any logic...
Please help... please.. this is eating my head... :-(
 
Top