CREATE OR REPLACE FUNCTION core.get_country_id_by_country_code(character varying) RETURNS integer LANGUAGE plpgsql STABLE AS $function$ BEGIN RETURN country_id FROM core.countries WHERE country_code = $1; END $function$