nv-l
[Top] [All Lists]

RE : Setting fields in NV database

To: nv-l@lists.tivoli.com
Subject: RE : Setting fields in NV database
From: Luc.BARNOUIN@FR.AIRSYSATM.THOMSON-CSF.COM
Date: Wed, 30 Sep 1998 14:35:05 +0200
Reply-to: Discussion of IBM NetView and POLYCENTER Manager on NetView et alia <NV-L@UCSBVM.UCSB.EDU>
Sender: Discussion of IBM NetView and POLYCENTER Manager on NetView et alia <NV-L@UCSBVM.UCSB.EDU>
Joe,

Netview does the job for you. Just have a look to the 
"OVwDbListObjectsByFieldValues" function.
Attached is a sample of code using it ...

Luc Barnouin
Airsys ATM - France

>Does anyone have an example of code of how to loop through the entire NV
>database in order to set a specific field?  I have code that sets a field
>for a specific NV Selection name, but now I want to cycle through the entire
>NV database looking for any selection names that have a particular value for
>this specific field and then change it accordingly.  I am not sure on how I
>design the looping part of the code.  Thanks in advance,
>
>
>Joe Prokott - West Group
>Network Architect
>610 Opperman Drive
>St. Paul, MN  55123
>Phone: 651-687-4536
>Fax: 651-687-6946
>E-mail: joe.prokott@westgroup.com
void dbas_reset_vertices_status ()
{
  OVwObjectIdList     *object_list;
  OVwFieldBindList    list_of_fields;
  OVwObjectId         object_id;
  U_Int               index;
  PChar               vertex_name;
  nvotStatusType      vertex_status = STATUS_UNKNOWN;

  /* point to the first field binding item */
  list_of_fields.fields = &field_binding[FIRST_FIELD];
  list_of_fields.count = FIELD_NB;

  object_list = OVwDbListObjectsByFieldValues (&list_of_fields);

  if (object_list == NULL)
  {
    error_raised = ERR_DTB_NO_VERTEX;
    error_handler ("dbas_reset_vertices_status",__FILE__,__LINE__,
                   "%s",OVwErrorMsg(OVwError( )));
  }
  else
  {
    if (object_list->count == 0)
    {
      error_raised = ERR_DTB_NO_VERTEX;
      error_handler ("dbas_reset_vertices_status",__FILE__,__LINE__,
                   "No object is Vertex and isE2000 on TRUE at the same time");
    }
    else
    {
      /* for each object in the list */
      for (index = 0 ; index < object_list->count ; index++)
      {
        /* Get it selection name */
        object_id = object_list->object_ids[index];
        vertex_name = OVwDbObjectIdToSelectionName(object_id);
        if (vertex_name == NULL)
        {
          error_raised = ERR_DTB_NO_SELECTION_NAME;
          error_handler ("dbas_reset_vertices_status",__FILE__,__LINE__,
           "object_id=%d, error=%s", object_id, OVwErrorMsg(OVwError( )));
        }
        else
        {
          /* reset vertex status to "unknown" */
          change_vertex_status (vertex_name,vertex_status);
          /* free the string memory allocated for vertex_name */
          serv_free (vertex_name);
        }
      }
    }
    /* Free the object id list */
    OVwDbFreeObjectIdList (object_list);
  }
}

<Prev in Thread] Current Thread [Next in Thread>
  • RE : Setting fields in NV database, Luc . BARNOUIN <=

Archive operated by Skills 1st Ltd

See also: The NetView Web