Next Previous Up Contents
Next: tapresume: Resumes a previous query to a Table Access Protocol server
Up: tapquery: Queries a Table Access Protocol server
Previous: Usage

B.25.2 Examples

Here are some examples of tapquery:

stilts tapquery tapurl='http://dc.zah.uni-heidelberg.de/__system__/tap/run/tap'
                adql='SELECT TOP 1000 * FROM ppmxl.main'
                out=ppmxl.fits
Executes the given ADQL query on the service referenced by the URL and writes the result to a FITS file.
stilts tapquery
       tapurl='http://dc.zah.uni-heidelberg.de/__system__/tap/run/tap'
       adql="SELECT *
                FROM twomass.data AS t
                JOIN TAP_UPLOAD.up1 AS s
                ON 1=CONTAINS(POINT('ICRS', t.RAJ2000, t.DEJ2000),
                              CIRCLE('ICRS', s.ra2000, s.dec2000, 5./3600.))"
       nupload=1 upload1=6dfgs_E7.fits ucmd1='select BMAG-RMAG<0'
       maxrec=20000
       ocmd='tablename 2mass_x_6df' omode=topcat
The local table 6dfgs_E7 is filtered to contain only rather blue objects, and the resulting selection is uploaded to the TAP server. A positional crossmatch with 5 arcsec tolerance is then performed on the server between this uploaded table and the twomass.data table held by the service. The adjusted maxrec parameter ensures that the result will not be artificially truncated to shorter than 20000 rows (assuming the service limits permit this). When the result is received, it is loaded directly into TOPCAT with the name "2mass_x_6df".


Next Previous Up Contents
Next: tapresume: Resumes a previous query to a Table Access Protocol server
Up: tapquery: Queries a Table Access Protocol server
Previous: Usage

STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note256
STILTS web page: http://www.starlink.ac.uk/stilts/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk