Getting Unassigned DNs?

Version 1
    This document was generated from CDN thread

    Created by: Alex Arwine on 02-10-2008 09:48:50 PM
    Was hoping to get a list of unassigned DNs via AXL.

    Noticed that there didn't seem to be a function.

    Any ideas or alternate solutions?

    Thanks!
    -Alex

    Subject: Re: Getting Unassigned DNs?
    Replied by: David Staudt on 03-10-2008 02:32:20 AM
    You will need to do something via <executeSQLQuery> for this.

    Check the Data Dictionary for the tables and fields, but if 'Unassigned DNs' are DNs which do not appear on any device, something like this might work:

    select dnorpattern from numplan where numplan.pkid not in (select fknumplan from devicenumplanmap)

    Subject: Re: Getting Unassigned DNs?
    Replied by: Alex Arwine on 03-10-2008 08:35:35 PM
    Works GREAT!

    Looks like it truncates due to char limits?
    Is this true? Maybe it's my c buffer or something.
    I'll look into it.

    Thanks,
    -Alex

    Subject: Re: Getting Unassigned DNs?
    Replied by: Alex Arwine on 03-10-2008 10:23:50 PM
    Just so you know, it was my char array buffer size.

    I also modified the sql query to only return the extensions starting with 5 or 3.

    Might be useful to someone else, so here it is.
    select dnorpattern from numplan where numplan.pkid not in (select fknumplan from devicenumplanmap) and (substring(dnorpattern FROM 1 FOR 1) = '5' or substring(dnorpattern FROM 1 FOR 1) = '3')

    Thanks again!
    -Alex