freeppy
28th July 2009, 11:07
hi,consultants
When we print the Customize Report ,it costs much a long time,or it does't get any report in the end ,why?How can I solve the problem,pls show me.Thanks all!

george7a
28th July 2009, 12:53
Hi,

Can you post the report code?

- George

freeppy
28th July 2009, 13:12
hi,George
the attachment is the Script,pls give your suggestions。Thanks!

saumya
28th July 2009, 13:53
select whinh312.*,
tcibd001.dsca,
tdpur401.*,
tdpur400.*,
whinh310.dino,
tccom100.nama
from whinh312,
tcibd001,
tdpur401,
tdpur400,
whinh310,
tccom100,
tccom120 |HERE U HAVE CALLED TCCOM120 but missed in select clause
where whinh312.item refers to tcibd001
and whinh312.rcno refers to whinh310
and tdpur401._index1 = {whinh312.orno, whinh312.pono, whinh312.seqn}
and tdpur401.orno refers to tdpur400
and tdpur400.otbp refers to tccom120
and tccom120.otbp refers to tccom100
and whinh312._index1 inrange {:rcno.f} and {:rcno.t}
and whinh312._index2 inrange {whinh.oorg.purchase, :orno.f} and {whinh.oorg.purchase, :orno.t}
and (whinh312._index5 inrange {:item.f} and {:item.t})
and (whinh312.ardt inrange :ardt.f and :ardt.t)
and (tdpur400.otbp inrange {:otbp.f} and {:otbp.t})
order by whinh312.item, whinh312.rcno | 200907

selectdo

|IN WHERE CLAUSE TCCOM100, whinh310, HAS NO REFERENCE.

Plz check other sql querry also.
If u wont give reference to any mentioned table in select it will read all records, becz of that report will take longer time.

freeppy
29th July 2009, 03:47
hi,saumya
Thanks.Pls add the reference and show it to me,for I am new.very appreciate.

freeppy
29th July 2009, 04:41
hi,all
I send the report script for all your reference,pls check and tell me what is the matter ,Thanks.

freeppy
29th July 2009, 05:17
hi,all
I also send the Debugger to you,pls see the attachment.Thanks.

saumya
29th July 2009, 07:34
hi freeppy,

I m working on baan4c4. I dont have wh module implemented. so i can not give references of table belonging to this module

freeppy
29th July 2009, 10:24
saumya,thanks all the same.

wiggum
29th July 2009, 11:58
I don't know how good the database access will be optimized perhaps as your range conditions in the where clause are at the end of the clause it can be that the database will read all records of table whinh312 and check the read records with the following conditions.

Try to put the range conditions on table whinh312 at the top of the where clause.

mark_h
29th July 2009, 15:07
Well to me it looks like all the tables are in that query. I re-org'ed the query the way I would write it - well almost. A lot of tables with .* on them. If the tables have a lot fields only pull the ones you need.

select whinh312.*, tcibd001.dsca, tdpur401.*, tdpur400.*, whinh310.dino, tccom100.nama, whinr110.*
from whinh312, tcibd001, tdpur401, tdpur400, whinh310, tccom100, tccom120, whinr110
where whinh312._index2 inrange {whinh.oorg.purchase, :orno.f} and {whinh.oorg.purchase, :orno.t}
and whinh312.rcno inrange :rcno.f and :rcno.t
and whinh312.item inrange :item.f and :item.t
and whinh312.item refers to tcibd001
and tdpur401._index1 = {whinh312.orno, whinh312.pono, whinh312.seqn}
and tdpur401.orno refers to tdpur400
and tdpur400.otbp inrange {:otbp.f} and {:otbp.t}
and tdpur400.otbp refers to tccom120
and whinh312.rcno refers to whinh310
and tccom120.otbp refers to tccom100
and whinr110._index2 = {:wf.company, tckoor.act.pur, whinh312.orno, whinh312.pono}
and whinr110.rcno = whinh312.rcno
and whinr110.rcln = whinh312.rcln
and whinr110.trdt inrange :ardt.f and :ardt.t
order by whinh312.item, whinh312.rcno | 200907

You would have to play with the query to figure out the final solution - in some cases the coding is quicker if you do nested queries. For example (testing and playing with the query will give you the final results) you could pull tcibd001 out of the query - put it in side the select do like below - do this only when you have a record to send to the report. Reduce the number of I/O's.

select tcibd001.dsca
from tcibd001
where tcibd001._index1 = {:whinh312.item}
as set with 1 rows
selectdo
endselect

Playing with the coding like this will help you decide the best way to run the query. Infor's support site should have a guide on how to maximize performance when coding.

freeppy
30th July 2009, 14:04
Thanks all.