next up previous contents
Next: Clearing the database Up: Querying the database Previous: Querying the anagraphical data   Contents

Querying the values

Example code to query all the values in a given area and time:

      call idba_seti(handle, "latmin", 30)
      call idba_seti(handle, "latmax", 50)
      call idba_seti(handle, "lonmin", 10)
      call idba_seti(handle, "lonmax", 20)
      call idba_seti(handle, "yearmin", 2004)
      call idba_seti(handle, "yearmax", 2004)
      call idba_voglioquesto(handle, count)
      do while (count.gt.0)
        call idba_dammelo(handle, param)
c       get the value of this variable
        call idba_enqc(handle, param, cvalue)
        call idba_enqd(handle, "lat", dlat)
        call idba_enqd(handle, "lon", dlon)
c       query more data and work with it
        count = count - 1
      enddo

This code introduces two new functions:

idba_voglioquesto
performs the query and returns the number of values it finds.
idba_dammelo
gets a value out of the result of idba_voglioquesto. If there are no more stations, the function fails.



root 2007-06-20