<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to interpret the cucm database query results from python scripts? in Call Control</title>
    <link>https://community.cisco.com/t5/call-control/how-to-interpret-the-cucm-database-query-results-from-python/m-p/4597787#M3242</link>
    <description>&lt;P&gt;sql = '''select * from device where name = "ATAD4ADBDCECF72" '''&lt;/P&gt;&lt;P&gt;# Execute the executeSQLQuery request&lt;BR /&gt;try:&lt;BR /&gt;resp = service.executeSQLQuery( sql )&lt;BR /&gt;except Fault as err:&lt;BR /&gt;print('Zeep error: executeSQLQuery: {err}'.format( err = err ) )&lt;BR /&gt;else:&lt;BR /&gt;print( '\nexecuteSQLQuery response:' )&lt;BR /&gt;print( resp )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is the result:&lt;/P&gt;&lt;P&gt;executeSQLQuery response:&lt;BR /&gt;{&lt;BR /&gt;'return': {&lt;BR /&gt;'row': [&lt;BR /&gt;[&lt;BR /&gt;&amp;lt;Element pkid at 0x108277780&amp;gt;,&lt;BR /&gt;&amp;lt;Element name at 0x1082777c0&amp;gt;,&lt;BR /&gt;&amp;lt;Element description at 0x108277800&amp;gt;,&lt;BR /&gt;&amp;lt;Element tkmodel at 0x108277840&amp;gt;,&lt;BR /&gt;&amp;lt;Element tkdeviceprotocol at 0x108277880&amp;gt;,&lt;BR /&gt;&amp;lt;Element tkprotocolside at 0x1082778c0&amp;gt;,&lt;BR /&gt;&amp;lt;Element specialloadinformation at 0x108277900&amp;gt;,&lt;BR /&gt;&amp;lt;Element fkdevicepool at 0x108277940&amp;gt;,&lt;BR /&gt;&amp;lt;Element fkphonetemplate at 0x108277980&amp;gt;,&lt;BR /&gt;&amp;lt;Element fkcallingsearchspace at 0x1082779c0&amp;gt;,&lt;BR /&gt;&amp;lt;Element ctiid at 0x108277a00&amp;gt;,&lt;BR /&gt;&amp;lt;Element tkclass at 0x108277a40&amp;gt;,&lt;BR /&gt;&amp;lt;Element fkprocessnode at 0x108277a80&amp;gt;,&lt;BR /&gt;&amp;lt;Element defaultdtmfcapability at 0x108277ac0&amp;gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is what I get if I run the same query from CLI, which is what I expect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;9f4e0c6b-6dd8-3c35-cce4-1a933af6db5e ATAD4ADBDCECF72 TX-JST-258 PAGING ATA 36262 11 1 704d9468-d9a7-175c-a441-21468d445491 50155d0c-a8ca-4a6c-93f1-96ac528d3518 5ea64ecb-9588-d8ef-a2f4-5f9e7187f31e 83176 1 NULL 0 eaa446f1-56e3-8137-ef7a-076c3bb3295a 36715 NULL f 0ed8c1a1-dbf1-4c63-295a-2f2b5bf50d4c f 0 NULL NULL 2 NULL 0 0 64 1 NULL NULL NULL NULL t f NULL 0 0 2 f 4 0 0 1 NULL f f 2 f 1 d866cf12-ab4f-44cd-8cfc-e19e8b131a49 NULL NULL NULL f 1 f NULL fcbc7581-4d8d-48f3-917e-00b09fb39213 f f NULL NULL ad243d17-98b4-4118-8feb-5ff2e1b781ac cb8b5944-5226-1e61-2ee0-0837b73d3ff8 0 1 f f t 1 1635873403-6ce180f5-dd3f-4beb-a03e-8584e6b9439c 6077e70d-b810-76d4-9d20-bd101f89c462 f f&lt;/P&gt;</description>
    <pubDate>Fri, 22 Apr 2022 12:36:59 GMT</pubDate>
    <dc:creator>Young2020</dc:creator>
    <dc:date>2022-04-22T12:36:59Z</dc:date>
    <item>
      <title>how to interpret the cucm database query results from python scripts?</title>
      <link>https://community.cisco.com/t5/call-control/how-to-interpret-the-cucm-database-query-results-from-python/m-p/4597787#M3242</link>
      <description>&lt;P&gt;sql = '''select * from device where name = "ATAD4ADBDCECF72" '''&lt;/P&gt;&lt;P&gt;# Execute the executeSQLQuery request&lt;BR /&gt;try:&lt;BR /&gt;resp = service.executeSQLQuery( sql )&lt;BR /&gt;except Fault as err:&lt;BR /&gt;print('Zeep error: executeSQLQuery: {err}'.format( err = err ) )&lt;BR /&gt;else:&lt;BR /&gt;print( '\nexecuteSQLQuery response:' )&lt;BR /&gt;print( resp )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is the result:&lt;/P&gt;&lt;P&gt;executeSQLQuery response:&lt;BR /&gt;{&lt;BR /&gt;'return': {&lt;BR /&gt;'row': [&lt;BR /&gt;[&lt;BR /&gt;&amp;lt;Element pkid at 0x108277780&amp;gt;,&lt;BR /&gt;&amp;lt;Element name at 0x1082777c0&amp;gt;,&lt;BR /&gt;&amp;lt;Element description at 0x108277800&amp;gt;,&lt;BR /&gt;&amp;lt;Element tkmodel at 0x108277840&amp;gt;,&lt;BR /&gt;&amp;lt;Element tkdeviceprotocol at 0x108277880&amp;gt;,&lt;BR /&gt;&amp;lt;Element tkprotocolside at 0x1082778c0&amp;gt;,&lt;BR /&gt;&amp;lt;Element specialloadinformation at 0x108277900&amp;gt;,&lt;BR /&gt;&amp;lt;Element fkdevicepool at 0x108277940&amp;gt;,&lt;BR /&gt;&amp;lt;Element fkphonetemplate at 0x108277980&amp;gt;,&lt;BR /&gt;&amp;lt;Element fkcallingsearchspace at 0x1082779c0&amp;gt;,&lt;BR /&gt;&amp;lt;Element ctiid at 0x108277a00&amp;gt;,&lt;BR /&gt;&amp;lt;Element tkclass at 0x108277a40&amp;gt;,&lt;BR /&gt;&amp;lt;Element fkprocessnode at 0x108277a80&amp;gt;,&lt;BR /&gt;&amp;lt;Element defaultdtmfcapability at 0x108277ac0&amp;gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is what I get if I run the same query from CLI, which is what I expect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;9f4e0c6b-6dd8-3c35-cce4-1a933af6db5e ATAD4ADBDCECF72 TX-JST-258 PAGING ATA 36262 11 1 704d9468-d9a7-175c-a441-21468d445491 50155d0c-a8ca-4a6c-93f1-96ac528d3518 5ea64ecb-9588-d8ef-a2f4-5f9e7187f31e 83176 1 NULL 0 eaa446f1-56e3-8137-ef7a-076c3bb3295a 36715 NULL f 0ed8c1a1-dbf1-4c63-295a-2f2b5bf50d4c f 0 NULL NULL 2 NULL 0 0 64 1 NULL NULL NULL NULL t f NULL 0 0 2 f 4 0 0 1 NULL f f 2 f 1 d866cf12-ab4f-44cd-8cfc-e19e8b131a49 NULL NULL NULL f 1 f NULL fcbc7581-4d8d-48f3-917e-00b09fb39213 f f NULL NULL ad243d17-98b4-4118-8feb-5ff2e1b781ac cb8b5944-5226-1e61-2ee0-0837b73d3ff8 0 1 f f t 1 1635873403-6ce180f5-dd3f-4beb-a03e-8584e6b9439c 6077e70d-b810-76d4-9d20-bd101f89c462 f f&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 12:36:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/how-to-interpret-the-cucm-database-query-results-from-python/m-p/4597787#M3242</guid>
      <dc:creator>Young2020</dc:creator>
      <dc:date>2022-04-22T12:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to interpret the cucm database query results from python scrip</title>
      <link>https://community.cisco.com/t5/call-control/how-to-interpret-the-cucm-database-query-results-from-python/m-p/4598154#M3243</link>
      <description>&lt;P&gt;Hi Young,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 'resp' object is a dictionary of list of list of objects. You may want to try to de-reference the obj to print out the value. For example:&lt;/P&gt;&lt;P&gt;record = resp['row'][0]&lt;/P&gt;&lt;P&gt;print(record)&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;print(record['pkid'])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Python, it's helpful to use print(type(obj)) to determine if obj is a list or a dictionary or first class variable type then go from there.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-david&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:49:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/call-control/how-to-interpret-the-cucm-database-query-results-from-python/m-p/4598154#M3243</guid>
      <dc:creator>davidn#</dc:creator>
      <dc:date>2022-04-25T23:49:45Z</dc:date>
    </item>
  </channel>
</rss>

