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

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 = 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))

BEGIN
	DECLARE link varchar(128), run varchar(8), rerun varchar(8),
		camcol varchar(8), field varchar(8), run6 varchar(10);
	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))
