cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
453
Views
0
Helpful
0
Replies

passing python list to AXL sql query

Hi, can someone assist me with this--

I'm gathering a list of phones and would like to past this list into AXL query to fetch various mapped attributes.
my current snippet looks something like this:

testList = ['SEP00001AE11234', 'SEP005056901235']
soaprequest = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5"><soapenv:Header/><soapenv:Body><ns:executeSQLQuery sequence="?"><sql>select np.dnorpattern dn, np.description dn_description, rp.name rp_name, np.alertingname alerting_name, np.alertingnameascii ascii_alerting, dnmap.label label, dnmap.display display, dnmap.numplanindex index, dnmap.displayascii display_ASCII, d.name phone_Name, d.description phone_Description from numplan np inner join routepartition as rp on np.fkroutepartition=rp.pkid inner join devicenumplanmap dnmap on dnmap.fknumplan = np.pkid inner join device d on dnmap.fkdevice = d.pkid where dnorpattern like "8%"and numplanindex = "1" and d.name IN {}.format(t) and len (dnorpattern) = 7 order by dn</sql></ns:executeSQLQuery></soapenv:Body></soapenv:Envelope>'

i'm getting stuck at the IN clause - 'and d.name IN {}.format(testList)
Thanks

0 Replies 0