idlastro / Database Procedures: DBGET

[Source code]

NAME
DBGET
PURPOSE
Find entry numbers which contain specified values of a given item.
EXPLANATION
DBGET() is useful as an alternative to DBFIND() when the desired 
search values are not easily expressed as a string.  
CALLING SEQUENCE
list = dbget( item, values, [ listin ], /SILENT, /FULLSTRING )
INPUTS
item - Item name or number
values -  scalar or vector containing item values to search for.
OPTIONAL INPUTS
listin - list of entries to be searched.  If not supplied, or
        set to -1, then all entries are searched
OUTPUT
list - vector giving the entry number of entries containing desired
        item values.  The number of elements in  LIST may be different 
        from that of VALUE, since a value might be located zero, once, 
        or many times in the database.  Use the function DBMATCH if a 
        one to one correspondence is desired between VALUES and LIST. 
OPTIONAL INPUT KEYWORDS
/SILENT - If this keyword is set, then DBGET will not display
        the number of entries found
/FULLSTRING - By default, one has a match if a search string is 
        included in any part of a database value (substring match).   
        But if /FULLSTRING is set, then all characters in the database
        value must match the search string (excluding leading and 
        trailing blanks).    Both types of string searches are case
        insensitive.
OPTIONAL OUTPUT KEYWORD
COUNT - Integer scalar giving the number of valid matches
RESTRICTIONS
When linked databases are opened together, DBGET can only be used to
search on items in the primary database.
EXAMPLE
Get info on selected HD stars in Bright Star catalogue
IDL> dbopen, 'YALE_BS' 
IDL> hdno = [1141,2363,3574,4128,6192,6314,6668]    ;Desired HD numbers
IDL> list = dbget( 'HD', hdno )        ;Get corresponding entry numbers
SYSTEM VARIABLES
The obsolete system variable !ERR is set to number of entries found
REVISION HISTORY
Written,    W. Landsman      STX     February, 1989
William Thompson, GSFC, 14 March 1995 Added keyword FULLSTRING
Converted to IDL V5.0   W. Landsman   September 1997
Added COUNT keyword, deprecate !ERR        W. Landsman March 2000
Fix bug introduced March 2000              W. Landsman November 2000
Fix possible bug when sublist supplied    W. Landsman August 2008