 BEGIN
 	DECLARE link varchar(128), run varchar(8), rerun varchar(8),
 		camcol varchar(8), field varchar(8), run6 varchar(10);
-	SET link = (select value from SiteConstants where name='DataServerURL');
+	SET link = (select val from SiteConstants where name='DataServerURL');
 	SET link = link || 'imaging/';
 	SELECT  run = cast(run as varchar(8)), rerun=cast(rerun as varchar(8)), 
 		camcol=cast(camcol as varchar(8)), field=cast(field as varchar(8))

	     				RETURN regionTable;			-- and return null table (in error case)
				)
			END IF;
			INSERT INTO regionTable values( 	convexid,
						cast(cx as float), 
						cast(cy as float), 
						cast(cz as float), 

CREATE FUNCTION fSpecClass(nme varchar(40))
RETURNS INTEGER
BEGIN
RETURN ( SELECT value
	FROM SpecClass
	WHERE name = UPPER(nme)
	);
