03-16-2017 03:03 PM - edited 03-19-2019 12:13 PM
All,
I am proud to say I am getting better at Querying the SQL database. I am learning of table relationships and such. However, I have hit a roadblock, can you help?
I need an SQL statement that inputs a device name (SEPXXXXXXXXXXXX) and a device Pool XX_XX_DP and updates that device to that device pool. I know that the result of querying the device table for the field fkdevicepool gives a guid and I assume that my update statement has to update the fkdevicepool field to a guid. I hope that I do not have to do this in a 2 step approach where I first have to get the guid of the device pool and then do my update statement. That would suck.
Thanks for the help.
P.S.
Can the same logic be applied to updating a CSS and such?
Solved! Go to Solution.
03-21-2017 10:21 AM
You don't need to know the ID of the Device Pool you want to use to Update a Device..you can use the Device Pool Name..
update device set fkdevicepool=(select pkid from devicepool as dp where dp.name="DP_NAME") where device.name="#DEVICENAME"
SOAPUI is a good tool to use to experiment with these sort of calls..and if you don't have a lab..you could see if devnetsandbox.com will allow you to reserve an environment where you can play..
03-17-2017 07:35 PM
I use Telisca CUCMQuery tool instead of creating sql query for each MAC address. Is device pool different for each device?
03-21-2017 10:57 AM
Thank you V.
I am looking into your suggestion.
03-21-2017 10:21 AM
You don't need to know the ID of the Device Pool you want to use to Update a Device..you can use the Device Pool Name..
update device set fkdevicepool=(select pkid from devicepool as dp where dp.name="DP_NAME") where device.name="#DEVICENAME"
SOAPUI is a good tool to use to experiment with these sort of calls..and if you don't have a lab..you could see if devnetsandbox.com will allow you to reserve an environment where you can play..
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide