10-17-2008 09:55 AM - edited 03-13-2019 05:44 PM
Is there a way to fire off an update query like:
Update devices set description = 'A' where description = 'B'
I get a "no update permission" error.
Yes, this a bad idea for many reasons, but I'm not willing to let that stop me, at least in this lab/test scenario...
10-19-2008 05:37 PM
you probably don't have correct credentials,
have you tried through CLI?
(and tried using device instead of devices (the s)
admin:run sql update device set description='test' where description='SEP00xxxxxxxxxx'
Rows: 1
10-20-2008 04:43 AM
Hmm... could be a bug since it's supposed to tell you that the table devices does not exist.
And there are no different levels of axl access.. if your user has axl access (and thus can send sql queries for instance) the update commands must work (unless you try to do something that would violate the db constraints.. in that case you'll get an error from the database layer telling you what you're trying to do is not permitted).
10-20-2008 06:59 AM
Thanks for the response Stephan and s. Sorry - the original post had a typo. I was using the proper table name.
I didn't realize that there was a command line option. I've been avoiding the command line because I don't know too much about it. The command line option worked:
admin:run sql update device set description= "Test" where name="SEP000000032081"
Rows: 1
admin:
Of course this morning, I get something totally different from AXL (but these are the actual reuest and response envelopes):
sent:
received:
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
-79750
10-20-2008 08:57 AM
Hmmmâ¦. The plot thickens. I received an eval phone that I was trying to set up. I was trying to update the tkModel field to the appropriate value so that the phone registration would not be rejected. Apparently update permissions are set on a field by field basis - unless I am missing some referential integrity issue here.
SO, this query works:
admin:run sql update Device set Description="Wes 7 9 2 5" where name = "SEP002290EA9F61"
Rows: 1
But this one does not work:
admin:run sql update Device set tkModel=484 where name = "SEP002290EA9F61"
No UPDATE permission.
Ironically, when I look at the type model table, there is an entry, but it's obviously "turned off". Guess I'll have to try and track down a patch or see what I need to turn it on!
admin:run sql select * from TypeProduct where enum=371
enum name moniker tkmodel maxports showindropdown devicenameformat isinstalleddefault devicenamestring
==== ========== ================== ======= ======== ============== ================================= ================== ================
371 Cisco 7925 PRODUCT_CISCO_7925 484 0 f ([sS][eE][pP]|BAT)[0-9a-fA-F]{12} f SEP[mac]
a
10-20-2008 11:41 AM
in axl you need to use executeSQLUpdate (insted of Query)
and you can never change the model of a phone, you need to delete it, and recreate it with the correct type
hth
10-20-2008 11:58 AM
Ahhh - it was the executeSQLUpdate that was throwing me...
10-21-2008 04:22 AM
hmm... the error is still weird though.. axl is supposed to tell you that you cannot make updates with executeSQLQuery... at least I recall it telling me so.
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