call idba_preparati(dbhandle, handle, "read", "read", "read")
call idba_preparati(dbhandle, handleana, "read", "read", "read")
c Prepare a query
call idba_setd (handle, "latmin", 10)
...
call idba_setd (handle, "lonmax", 60)
c Make the query
call idba_voglioquesto (handle, N)
c Iterate the results
do i=1,N
call idba_dammelo (handle, varname)
c Read data about the variable we just had
call idba_enqlevel (handle, ltype, l1, l2)
c Read pseudoana data about the variable we just had
c Setup a query for the station with 'quantesono'
call idba_enqi (handle, "ana_id", anaid)
call idba_seti (handleana, "ana_id", anaid)
c Query. Nstaz should always be 1 because we query a specific station
call idba_quantesono (handleana, Nstaz)
c Fetch the data
call idba_elencamele (handleana)
c Read the data about the station
c All the data inserted with setcontextana is available here
call idba_enqi (handleana, "height", height)
enddo