FUNCTION  fGetNearestObjIdEq

Returns the objId of nearest photoPrimary within @r arcmins of ra, dec


ra, dec are in degrees, r is in arc minutes.
This scalar function is used for matchups of external catalogs.
It calls fGetNearestObjEq(@ra,@dec,@r), and selects the objId (a bigint).
This can be called by a single SELECT from an uploaded (ra,dec) table.
An example:

SELECT id, ra,dec, dbo.fGetNearestObjIdEq(ra,dec,3.0) as objId
FROM #upload
WHERE dbo.fGetNearestObjIdEq(ra,dec,3.0) IS NOT NULL

Input and output parameters

nametypelengthinoutpnum
@rafloat8input1
@decfloat8input2
@rfloat8input3
 bigint8input0