>i have a question: can anybody help me:
>i have a matrix that goes like this
>
>country_code + country + rate1 + rate2 + rate3
>01157 Colombia 0.23 0.24 0.19
>01158 Costa Rica 0.27 0.26 0.11
> . .
> . .
> . .
> n n countries
>
>
>the client has a preset rete of "rate3", he makes a call tothis number 0115758340625?
>the question is what do i need to do to compare the first six digits of the call to determine the country code and then the country and the rate...can anybody help me do that...
To get the first six digits of the the telephone number, do this (assuming the phone number is numeric and of non-fixed length):
nCountryCode = int(val(substr(str(1234567890),1,6)))
You would then select the code from your rate table above with some code similar to:
select country, rate from country_table where country_table.countrycode = nCountryCode