1. Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING) Click the link to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This message will disappear after you have made at least 12 posts. Thank you for your cooperation.

List all schedules for all nodes

Discussion in 'Scripting' started by jca001, Oct 23, 2012.

  1. jca001

    jca001 New Member

    Joined:
    Jun 30, 2008
    Messages:
    7
    Likes Received:
    0
    Location:
    Georgia
    We have been creating some new schedules and moving nodes from existing schedules to the new schedules. Because there is no move node from scheduleA to scheduleB, you have to do an add and deleted. So now I need to make sure we don't have a node on multiple schedules.

    I know I can get a list of all the nodes associated with each schedule via "q association" and then look at all the schedules for a duplicate nodes. But there are about 15 schedules and over 300 nodes. And I can see if a given node is associated with multiple schedules via

    select node_name,schedule_name from associations where node_name='ABC'

    But this means I would have to run the command over 300 times.

    What I want is to get a list of all the schedules for all the nodes.

    I have tried something like:

    select node_name,schedule_name from associations where node_name is (select node_name from node)

    But I cannot seem to get the correct syntax. I want the output to be something like:

    node_name schedule_name
    ----------- --------------
    ABC SCHED1
    DEF SCHED1
    DEF SCHED2
    GHI SCHED1
     
  2.  
  3. chad_small

    chad_small Moderator

    Joined:
    Dec 17, 2002
    Messages:
    2,207
    Likes Received:
    44
    Occupation:
    AIX/SAN/TSM
    Location:
    Gilbert, AZ
    I must be missing something because the following select would easily show all nodes associated with a schedule and order them by the node_name then by schedule_name.

    select node_name, schedule_name from associations order by node_name, schedule_name
     
  4. jca001

    jca001 New Member

    Joined:
    Jun 30, 2008
    Messages:
    7
    Likes Received:
    0
    Location:
    Georgia
    Chad:
    No, you are not missing anything, I am. The little I know about SQL is using something sombody else wrote and making minor changes.

    Thanks for the quick reply, that is exactly what I was looking for.

    I ran it and from the first page I found 2 nodes on multiple schedules and they were not even some we have been working with. They have probably been there for a while.
     

Share This Page