PROCEDURE cust_insert (p_c_name IN VARCHAR (50),                               /* PL/SQL */
                       p_o_name IN VARCHAR (50),
                       p_c_credit_limit IN NUMBER (16, 2))
IS
    v_c_id NUMBER;
    v_o_id NUMBER;
BEGIN
    EXECUTE IMMEDIATE
        'INSERT INTO sh.customer (company_name, credit_limit) ' ||
                         'VALUES (:p_c_name, :p_c_credit_limit)'        
    USING
        p_c_name, p_c_credit_limit
    RETURNING
        customer_id INTO v_c_id;

    EXECUTE IMMEDIATE
        'INSERT INTO sh.office (name) ' ||
                       'VALUES (:p_o_name)'
    USING
        p_o_name
    RETURNING
        office_id INTO v_o_id;

    EXECUTE IMMEDIATE
        'INSERT INTO sh.customer_report (customer_id, office_id) ' ||
                                'VALUES (:v_c_id, :v_o_id)'
    USING
        v_c_id, v_o_id;

    COMMIT;
END;