Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any ideas to index/speed this up?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00810823
Message ID:
00811284
Views:
12
Steve,

When you are just browsing, from the command window what does empty(cdr.rate) return? Is it always .T.? Is your post-replace _Tally significantly larger than your call count? Do you have set exact off?

I've seen some weird things with set exact on and non-exact relations. My guess is that you're getting empty() all of the time. You can test this by changing your FOR to empty(cdr.rates) and !empty(cdr.dnis)


>
>SELECT cdr
> INDEX ON dnis TAG dnis
>SELECT rate
> INDEX ON code TAG code desc
>SET RELATION TO ALLTRIM(code) INTO cdr
>browse rate
>browse cdr
>
>this displays in the rate browse window (to stick with Argentina example)
>01154221 Argentina-La Plata
>0115411 Argentina-Buenos Aires
>01154 Argentina
>
>Your call to 0115411555555 shows up under both 0115411 and 01154.
>
>
>To compensate for this Dan had his code only replacing the charge and rate fields within your call record if they were still blank. They would be blank when buenos aires was reached and would be replaced with the values from the rate table. Then when the rating program reached Argentina it would still look at your call again, but the charge field would no longer be blank, so it wouldn't change it
>REPLACE...........FOR EMPTY(cdr.rate) Here's that code.
>
>SELECT cdr
> INDEX ON dnis TAG dnis
>SELECT rate
> INDEX ON code TAG code desc
>SET RELATION TO ALLTRIM(code) INTO cdr
>SET SKIP TO cdr
>REPLACE cdr.rate WITH rate ;
>, cdr.charge with IIF(cdr.duration>0,rate*cdr.billdur,0) :
>FOR empty(cdr.rate)
>
>I've tried changing it around, adding a "do while not eof" loop after setting the relation.
>
>Do while not eof()
>replace......for empty(cdr.rate)
>enddo
>
>then I added an if instead of the for clause (and tried both as well)
>
>Do while not eof()
>If empty(cdr.rate)
>replace......
>endif
>enddo
>
>and I keep ending up with your call getting rated to argentina instead of buenos aires. I'm not sure if the program is hitting the short rates 1st, or if it is just disregarding commands to only do replace operations on empty fields. I suspect the former, but can't figure out why.
>
>Sorry this is so long, just wanted to make it clear.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform