字體:小 中 大 | |
|
|
2017/03/08 09:54:49瀏覽528|回應0|推薦0 | |
參考 amri500
DEFINE l_fc_plant LIKE type_file.chr10 #FC來源廠區
#FC來源廠區
LET l_fc_plant = g_sma.ta_smac255
IF cl_null(l_fc_plant) THEN LET l_fc_plant = 'TW' END IF
LET l_fc_plant=s_dbstring(l_fc_plant CLIPPED)
#取FCNO確認數量
LET l_sql = "SELECT opd08,opd09,tc_opd61 ",
" FROM ",l_fc_plant CLIPPED,"opd_file",
" WHERE ta_opdc21 = '",g_msb[l_ac].ta_msbc43 CLIPPED,"'"
PREPARE i500_b_read_opd_p1 FROM l_sql
EXECUTE i500_b_read_opd_p1 INTO l_opd08,l_opd09,l_tc_opd61
IF STATUS THEN
.....
END IF
FREE i500_b_read_opd_p1
#檢查MPS備註為空,則帶入FCNO備註
IF l_n = 0 THEN
INITIALIZE l_tc_msoc.* TO NULL
LET l_tc_msoc03 = 0 #備註序號重排
LET l_sql="SELECT oao01,oao03,oao04,oao06 FROM ", l_fc_plant CLIPPED,"oao_file",
" WHERE oao01='",g_msb[l_ac].ta_msbc43 CLIPPED,"' and oao04 < 90 order by 1,2,3"
PREPARE oao_pre1 FROM l_sql
DECLARE oao_cs1 CURSOR FOR oao_pre1
FOREACH oao_cs1 INTO l_tc_msoc.*
LET l_tc_msoc.tc_msoc01 = g_msa.msa01
LET l_tc_msoc.tc_msoc02 = g_msb[l_ac].msb02
LET l_tc_msoc03 = l_tc_msoc03 + 1
LET l_tc_msoc.tc_msoc03 = l_tc_msoc03
INSERT INTO tc_msoc_file VALUES (l_tc_msoc.*)
END FOREACH
END IF
|
|
( 知識學習|其他 ) |