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
 
To count records you count them:
Code:
define variable i as integer no-undo.
for each customer no-lock:
  i = i + 1.
end.
display i.
or, possibly:
Code:
define query q for customer scrolling.
open query q preselect each customer no-lock.
display query q:num-results.

SQL statements within the 4GL are SQL 89. They are of of very limited utility and generally only lead to frustration. Especially for people who actually know SQL. Don't go there. Learn to love the 4GL or be prepared to be angry and frustrated.
 
To count records you count them:
Code:
define variable i as integer no-undo.
for each customer no-lock:
  i = i + 1.
end.
display i.
or, possibly:
Code:
define query q for customer scrolling.
open query q preselect each customer no-lock.
display query q:num-results.
SQL statements within the 4GL are SQL 89. They are of of very limited utility and generally only lead to frustration. Especially for people who actually know SQL. Don't go there. Learn to love the 4GL or be prepared to be angry and frustrated.




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... :-(
 
I take it that this query pertains to mfg/pro? Particularly since you seem to be posting the same question in both forums...

I don't know much about the relationships between tables in mfg/pro and your descriptions seem very muddled and confused to me so I don't have any specific suggestions vis a vis the needed WHERE clause.
 
Back
Top