Function@MySQL
CREATE FUNCTION `f-resource-p`(
resource INT
) RETURNS tinyint(1)
BEGIN
DECLARE cnt INT;
SELECT count(*) INTO cnt
FROM schema.rs_resource
WHERE `resource-id` = resource;
IF cnt=0 THEN
RETURN FALSE;
END IF;
RETURN TRUE;
END