Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any ideas to index/speed this up?
Message
From
17/07/2003 15:51:59
 
 
To
17/07/2003 04:40:53
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00810823
Message ID:
00811257
Views:
8
Thanks Agnes,

The code I put up was rating all the calls, just not on the longest rate that matched the DNIS [dialed number]

For instance lets say you make a call to "Argentina-Buenos Aires"
The number you called is 0115411555555

the dial code for buenos aires is "0115411" and .0128 cents per minute.
the dial code for all of argentina, that does not match a longer rate code is 01154 at .0285 cents per minute.

For some reason the code I put up(based on Dan's code) is rating all the calls to the shortest match (Argentina) instead of the longest match (Buenos Aires). Even though when I browse the tables related like the code (I'll put below) it shows the longer dial codes 1st, and displays the proper calls for the dial codes.


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