FUNCTION  fSpecidFromSDSS

Computes the long Spec IDs from its individual components.

The bit-fields (starting from bit# 63) and their lengths are:
plate[14] - bits 50-63 for the plate number,
fiber[12] - bits 38-49 for (MJD - 50000),
mjd[14] - bits 24-37 for the fiberid,
run2d[14] - bits 10-23 for the spec2d rerun, and
0 - bits 0-9 unused in SpecObj, used for line/redshift/index in other tables.
select dbo.fSpecidFromSDSS(266,51630,145) as specObjID

Input and output parameters

nametypelengthinoutpnum
@plateint4input1
@mjdint4input2
@fiberint4input3
@run2dvarchar32input4
 bigint8output0