
UPDATE T_PUR_QUOTE SET FTURNSCOUNT = FTURNS WHERE FTURNSCOUNT = ' ';
UPDATE T_PUR_INQUIRYSUPPLIER A SET FDEADLINE = (SELECT FENDDATE FROM T_PUR_INQUIRY WHERE (FID = A.FID AND (A.FDEADLINE IS NULL))) WHERE EXISTS (SELECT 1 FROM T_PUR_INQUIRY WHERE (FID = A.FID AND (A.FDEADLINE IS NULL)));
UPDATE T_PUR_INQUIRYSUPPLIER A SET (FENTRYCOUNT, FENTRYTURNS) = (SELECT B.FTURNS, B.FTURNS FROM T_PUR_INQUIRY B WHERE B.FID = A.FID) WHERE EXISTS (SELECT 1 FROM T_PUR_INQUIRY WHERE (FID = A.FID AND A.FENTRYCOUNT = ' ')) AND EXISTS (SELECT B.FTURNS, B.FTURNS FROM T_PUR_INQUIRY B WHERE B.FID = A.FID);
UPDATE T_PUR_INQUIRYSUPPLIER A SET FSUPPLIERBIZSTATUS = 'C' WHERE EXISTS (SELECT 1 FROM T_PUR_INQUIRYSUPPLIER B LEFT OUTER JOIN T_PUR_INQUIRY C ON B.fid = C.fid WHERE (((B.FENTRYID = A.FENTRYID AND A.FENTRYSTATUS = 'F') AND (C.FBIZSTATUS != 'E')) AND A.FSUPPLIERBIZSTATUS = ' '));
UPDATE T_PUR_INQUIRYSUPPLIER A SET FSUPPLIERBIZSTATUS = 'B' WHERE EXISTS (SELECT 1 FROM T_PUR_INQUIRYSUPPLIER B LEFT OUTER JOIN T_PUR_INQUIRY C ON B.fid = C.fid WHERE ((((B.FENTRYID = A.FENTRYID AND (A.FENTRYSTATUS != 'F')) AND (C.FBIZSTATUS != 'E')) AND A.FSUPPLIERBIZSTATUS = ' ') AND (A.FENTRYSTATUS != ' ')));
UPDATE T_PUR_INQUIRYSUPPLIER A SET FSUPPLIERBIZSTATUS = 'E' WHERE EXISTS (SELECT 1 FROM T_PUR_INQUIRYSUPPLIER B LEFT OUTER JOIN T_PUR_INQUIRY C ON B.fid = C.fid WHERE ((B.FENTRYID = A.FENTRYID AND C.FBIZSTATUS = 'E') AND A.FSUPPLIERBIZSTATUS = ' '));
UPDATE T_PUR_SCENE A SET FSCENERESULT = '1' WHERE A.FSCENERESULT = '2';
UPDATE T_PUR_INQUIRYTURNSLOG A SET FENTRYLOGSCOPE = (SELECT B.FSUPSCOPE FROM T_PUR_INQUIRY B WHERE B.fid = A.fid) WHERE EXISTS (SELECT 1 FROM T_PUR_INQUIRYTURNSLOG B LEFT OUTER JOIN T_PUR_INQUIRY C ON B.fid = C.fid WHERE (B.FENTRYID = A.FENTRYID AND B.FTURNS = '1'));
UPDATE T_PUR_INQUIRYTURNSLOG A SET FENTRYLOGSCOPE = '2' WHERE (A.FTURNS IN ('2', '3', '4', '5'));
