-- -- acs_sc_operation__get_id/2 -- create or replace function acs_sc_operation__get_id( character varying, character varying ) returns int4 as $$ declare p_contract_name alias for $1; p_operation_name alias for $2; v_operation_id integer; begin select operation_id into v_operation_id from acs_sc_operations where contract_name = p_contract_name and operation_name = p_operation_name; return v_operation_id; end;$$ language plpgsql;