next up previous contents
Next: Querying the values Up: Querying the database Previous: Querying the database   Contents

Querying the anagraphical data

Example code to query all the stations in a given area:

      call idba_setd(handle, "latmin", 30.D0)
      call idba_setd(handle, "latmax", 50.D0)
      call idba_setd(handle, "lonmin", 10.D0)
      call idba_setd(handle, "lonmax", 20.D0)
      call idba_quantesono(handle, count)
      do while (count.gt.0)
        call idba_elencamele(handle)
        call idba_enqi(handle, "ana_id", id)
c       Pseudoana values can be read as well:
        call idba_enqc(handle, "name", cname)
        call idba_enqd(handle, "B07001", height)
c       ...query more data and work with it...
        count = count - 1
      enddo

This code introduces two new functions:

idba_quantesono
performs the query and returns the number of stations it finds.

idba_elencamele
gets a station out of the results of idba_quantesono. If there are no more stations, the function fails.

After idba_elencamele, the output record will also contain all the pseudoana values available for the station on the network ana.



root 2007-06-20