CREATE OR REPLACE FUNCTION f_order_title_update_enquiryno(

    IN _orderno          integer,
    IN _enquiryno        varchar,


    IN upduser           character varying,
    IN pc                character varying,

    OUT errcd            integer,
    OUT errmsg           varchar,
    OUT code             integer) AS
$$

DECLARE
    cntcheck integer;
BEGIN
    --
    -- 存在チェック
    --
    SELECT orderno INTO cntcheck FROM t_order_title WHERE orderno = _orderno;

    IF FOUND THEN
        UPDATE t_order_title SET
            enquiryno       = _enquiryno
            WHERE orderno = _orderno;

    END IF;
    errcd := 1;
    errmsg := '完了';

    RETURN;
END;
$$
LANGUAGE 'plpgsql' VOLATILE;

