[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Repeat Procedures



Wanda,

I think what you want is a procedure that will select off the WORKORDER
table, and you control either using the WHERE clause, or LOOPS command.

begin-procedure Main
begin-select
EQNUM
   move &eqnum to $eqnum
  !Print whatever
   do get-workorders
  !Print some more
from Equipment
end-select
end-procedure

begin-procedure get-workorders
LET $eqnwhere = 'where eqnum = ' || '''' || $eqnum || ''''
begin select         ! loops=3 if you want to limit by count
wonum
workdate
     !Print whatever
from workorder
order by eqnum, workdate desc
where [$eqnwhere]
end-select
end-procedure


David L Smith
IBM Global Services