FINDFIRST and FIND('-') freeze for minutes on the same records while FINDSET(FALSE) finishes in1sec

kenyo
Member Posts: 40
So at first i was using find('-') because total records vary from under 10 to 600.000... i dont modify the database , just counting and categorizing them. 1 example had 150 records total and the transaction would freeze for minutes on the exact same two or three records when run for the first time a day ( every following time it would still freeze but for only a second or two. I've tried to do this in a report and in a cu with the same results. Even the records are the same every time. Debugging wouldn't help me because the freeze happens right before the entrance point into the next record. When using FINDSET(FALSE) i don't encounter the same problem. I have also commented out all content inside the loop - same problem.
part of code
Any ideas are appreciated.
Cheers.
part of code
IF l_RSubscrLine.FIND('-') THEN BEGIN REPEAT {code} UNTIL l_RSubscrLine.NEXT = 0; // this is where the debugger freezes END;
Any ideas are appreciated.
Cheers.
0
Answers
-
Hi,
In this article there is a very good explanation:
https://dynamicsuser.net/nav/b/waldo/posts/what-impact-does-my-c-al-have-on-sql
In loops you have to use FINDSET and never FINDFIRST.1 -
thanks but my find is not inside a loop , i added part of my code to the OP. Please keep in mind it also freezes if i have NO code inside the loop0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions