SQL query Mac Address and Line 1/Primary line (4.1.3)

Unanswered Question
Oct 17th, 2007

Is there any way to have an sql query where i can capture the Primary line/DN/Line 1 along with the mac , description etc. HEre is waht i use so far

select NumPlan.DNOrPattern as DirectoryNumber, Device.Name as DeviceName, Device.Description as UserDeviceProfileName, Device.LoginUserid as UserId, DeviceNumPlanMap.Display as DisplayIntCallerID,DeviceNumPlanMap.Label as LineTextLabel,

TypeModel.Name AS PhoneType,DeviceNumPlanMap.E164Mask as ExtPhoneMask, NumPlan.CFADestination as CallFWDALL, NumPlan.CFNADestination as CallFWDNoAnswer, NumPlan.CFBDestination as CallFWDBusy, devicepool.Name as DevPoolName

from numplan, devicenumplanmap, devicepool, device ,TypeModel

where DeviceNumPlanMap.fknumplan = numplan.pkid

and DeviceNumPlanMap.fkdevice = device.pkid

and device.fkdevicepool = devicepool.pkid

and device.tkmodel = typemodel.enum

and numplan.tkPatternUsage = 2

order by numplan.DnOrPattern


I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (1 ratings)
ckatene Thu, 10/18/2007 - 05:50

you're getting there. you will also need to reference devicenumplanmap.numplanindex so that you get the details of only the first line

... and devicenumplanmap.numplanindex = 1 ...


This Discussion