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

AXL ExecSQLUpdate

dhaelewyn
Level 4
Level 4

I have a couple of questions if someone wouldn't mind spending the time to reply.  If I have the NumPlanpkid for a [NumPlanDnOrPattern], in my case it's just a (DID) Directory Number on a [Device], (a hard phone, CIPC, and RDP).  Can I just delete the [NumPlanpkid] that's associated to the DN using ExecSQLUpdateRes (C#)?  Do I also need to manually delete any other corresponding fk(s) in other tables like those associated to all of the Device(s), End User, etc.?  Or, when I delete the pkid, CUCM cascades and cleans up that change to all of the other tables?  Is there a risk of corrupting the CUCM db by deleting object's pkids via AXL or does CUCM not allow updates that would compromise it?  Any help would be greatly appreciated.  Please elaborate on any of this if you care to.

4 Replies 4

npetrele
Cisco Employee
Cisco Employee

AXL removeLine is preferable to using executeSQLUpdate to accomplish what you want.

There are a number of rules that should be triggered for cleanup, so it's possible the cleanup is automatic, but I don't know.  I'd say the only way to know for sure is to set up a test DN, associate it with a line and a hunt pilot/group, then delete that row and see what happens.  If what you do violates a rule, you should get something like this:

Error messages from business rule violations have two components - Error code and SQL Exception. For example, Error: java.sql.SQLException: 37131, SQL State: IX000, Error Code: -746. Error Code -746 indicates an exception based on database rules.

You can peruse the database dictionary for yourself to see what depends on what, and what rules are associated with a table. Here's the dictionary for 10.5:

UCM 10.5(1) Data Dictionary

But, as I said, I'd go for removeLine, regardless.

It is strongly advised to use the regular AXL requests - e.g. <removeLine> - to perform operations like this, vs. direct database manipulation.  These AXL requests include the full set of logic and testing needed to ensure that changes are performed safely and completely, and are the formally tested/supported interface apps should target whenever possible.

The DB does have some built in data-integrity logic which should keep drastically wrong updates from happening, however this layer of functionality is partial, and was never intended or tested to be a robust external-facing API layer.  SQL should mainly be used for reads (where it can potentially be very effective and efficient), and used for updates only with extreme caution and full knowledge of the ramifications of the change being made.

Many thanks for getting back with me on this question.  I thought that might be the case.  So that leads to another question.  How do we remove a Directory Number from CUCM?  Doesn't removeLine() just remove that line from a Device (even if it's the last Device), but leave the Directory Number in the system?  Is there a way to remove the Directory Number completely from the system?

<removeLine> should remove the DN from the system.  To dissociate a DN from particular phone, you would use <updatePhone>