大概需求就是如下流程图,完成后需要连接另外B表、C表,连接后超过2K列,导出为.CSV文档到固定位置。(逻辑感觉很乱,数据也是查相近,但就是客户这样需求)
首先是控制台程序处理,完成后发现处理时间超过12h,就请教了DBA,DBA说程序不断循环与数据库交互会很影响时间,然后选择在数据库包里做数据处理,通过程序执行,10分钟左右执行完成。
代码过长,只做一个记录,只为以后遇到能有个参考:Loop将表当做程序中的Datatable来循环使用。
// An highlighted block
CREATE OR REPLACE PROCEDURE PTSMGR.UPD_PANDA_DATA_AABCLOGIC_MAIN(COND_MACHINE VARCHAR2,DCURRENT_DATE in varchar2) IS
M_COUNT INTEGER;
START_TIME VARCHAR2 (2000);
END_TIME VARCHAR2 (2000);
END_DTIME VARCHAR2 (2000);
START_TIMEKEY VARCHAR2 (2000);
END_TIMEKEY VARCHAR2 (2000);
--錯誤記录
RETURN_CODE NUMBER;
RETURN_SQL VARCHAR2(200);
V_TIMEKEY VARCHAR2(20);
MODELNAMEI VARCHAR2(200);
BEGIN
--日期
select to_char( (TO_DATE(DCURRENT_DATE,'yyyy-mm-dd')) -2,'yyyy-mm-dd')||' 00:00:00' into START_TIME from dual;
select to_char( (TO_DATE(DCURRENT_DATE,'yyyy-mm-dd')),'yyyy-mm-dd')||' 00:00:00' into END_DTIME from dual;
select to_char( (TO_DATE(DCURRENT_DATE,'yyyy-mm-dd')),'yyyy-mm-dd')||' 23:59:59' into END_TIME from dual;
--timekey
select to_char( (TO_DATE(DCURRENT_DATE,'yyyy-mm-dd')) -2,'yyyymmdd')||'000000000000' into START_TIMEKEY from dual;
select to_char( (TO_DATE(DCURRENT_DATE,'yyyy-mm-dd')),'yyyymmdd')||'235959000000' into END_TIMEKEY from dual;
IF COND_MACHINE='X1047' THEN
--清空表
DELETE X1047_DATA_AABCLOGIC_MAIN;
COMMIT;
--導入三天歷史數据
insert into X1047_DATA_AABCLOGIC_MAIN(G63_EVEN_FLICKER24HZ_P9,G63_EVEN_MAXFLICKER_P1,G63_EVEN_MAXFREQUENCY_P1,G63_EVEN_MAXFLICKER_P3,G63_EVEN_MAXFREQUENCY_P3,G63_EVEN_MAXFLICKER_P5,G63_EVEN_MAXFREQUENCY_P5,G63_EVEN_MAXFLICKER_P7,G63_EVEN_MAXFREQUENCY_P7,G63_EVEN_MAXFLICKER_P9,G63_EVEN_MAXFREQUENCY_P9,I2C_DATA_COMPARE_RESULT,G63_FLICKER39HZ_P1,G63_FLICKER39HZ_P3,G63_FLICKER39HZ_P5,G63_FLICKER39HZ_P7,G63_FLICKER39HZ_P9,G63_FLICKER40HZ_P1,G63_FLICKER40HZ_P3,G63_FLICKER40HZ_P5,G63_FLICKER40HZ_P7,G63_FLICKER40HZ_P9,G63_FLICKER41HZ_P1,G63_FLICKER41HZ_P3,G63_FLICKER41HZ_P5,G63_FLICKER41HZ_P7,G63_FLICKER41HZ_P9,G63_FLICKER42HZ_P1,G63_FLICKER42HZ_P3,G63_FLICKER42HZ_P5,G63_FLICKER42HZ_P7,G63_FLICKER42HZ_P9,G63_FLICKER43HZ_P1,G63_FLICKER43HZ_P3,G63_FLICKER43HZ_P5,G63_FLICKER43HZ_P7,G63_FLICKER43HZ_P9,G63_FLICKER44HZ_P1,G63_FLICKER44HZ_P3,G63_FLICKER44HZ_P5,G63_FLICKER44HZ_P7,G63_FLICKER44HZ_P9,G63_FLICKER45HZ_P1,G63_FLICKER45HZ_P3,G63_FLICKER45HZ_P5,G63_FLICKER45HZ_P7,G63_FLICKER45HZ_P9,G63_FLICKER46HZ_P1,G63_FLICKER46HZ_P3,G63_FLICKER46HZ_P5,G63_FLICKER46HZ_P7,G63_FLICKER46HZ_P9,G63_FLICKER47HZ_P1,G63_FLICKER47HZ_P3,G63_FLICKER47HZ_P5,G63_FLICKER47HZ_P7,G63_FLICKER47HZ_P9,G63_FLICKER48HZ_P1,G63_FLICKER48HZ_P3,G63_FLICKER48HZ_P5,G63_FLICKER48HZ_P7,G63_FLICKER48HZ_P9,G63_FLICKER49HZ_P1,G63_FLICKER49HZ_P3,G63_FLICKER49HZ_P5,G63_FLICKER49HZ_P7,G63_FLICKER49HZ_P9,G63_FLICKER50HZ_P1,G63_FLICKER50HZ_P3,G63_FLICKER50HZ_P5,G63_FLICKER50HZ_P7,G63_FLICKER50HZ_P9,G63_FLICKER51HZ_P1,G63_FLICKER51HZ_P3,G63_FLICKER51HZ_P5,G63_FLICKER51HZ_P7,G63_FLICKER51HZ_P9,G63_FLICKER52HZ_P1,G63_FLICKER52HZ_P3,G63_FLICKER52HZ_P5,G63_FLICKER52HZ_P7,G63_FLICKER52HZ_P9,G63_FLICKER53HZ_P1,G63_FLICKER53HZ_P3,G63_FLICKER53HZ_P5,G63_FLICKER53HZ_P7,G63_FLICKER53HZ_P9,G63_FLICKER54HZ_P1,G63_FLICKER54HZ_P3,G63_FLICKER54HZ_P5,G63_FLICKER54HZ_P7,G63_FLICKER54HZ_P9,G63_FLICKER55HZ_P1,G63_FLICKER55HZ_P3,G63_FLICKER55HZ_P5,G63_FLICKER55HZ_P7,G63_FLICKER55HZ_P9,G63_FLICKER56HZ_P1,G63_FLICKER56HZ_P3,G63_FLICKER56HZ_P5,G63_FLICKER56HZ_P7,G63_FLICKER56HZ_P9,G63_FLICKER57HZ_P1,G63_FLICKER57HZ_P3,G63_FLICKER57HZ_P5,G63_FLICKER57HZ_P7,G63_FLICKER57HZ_P9,G63_FLICKER58HZ_P1,G63_FLICKER58HZ_P3,G63_FLICKER58HZ_P5,G63_FLICKER58HZ_P7,G63_FLICKER58HZ_P9,G63_FLICKER59HZ_P1,G63_FLICKER59HZ_P3,G63_FLICKER59HZ_P5,G63_FLICKER59HZ_P7,G63_FLICKER59HZ_P9,G63_FLICKER60HZ_P1,G63_FLICKER60HZ_P3,G63_FLICKER60HZ_P5,G63_FLICKER60HZ_P7,G63_FLICKER60HZ_P9,G63_FLICKER61HZ_P1,G63_FLICKER61HZ_P3,G63_FLICKER61HZ_P5,G63_FLICKER61HZ_P7,G63_FLICKER61HZ_P9,G63_FLICKER62HZ_P1,G63_FLICKER62HZ_P3,G63_FLICKER62HZ_P5,G63_FLICKER62HZ_P7,G63_FLICKER62HZ_P9,G63_FLICKER63HZ_P1,G63_FLICKER63HZ_P3,G63_FLICKER63HZ_P5,G63_FLICKER63HZ_P7,G63_FLICKER63HZ_P9,G63_FLICKER64HZ_P1,G63_FLICKER64HZ_P3,G63_FLICKER64HZ_P5,G63_FLICKER64HZ_P7,G63_FLICKER64HZ_P9,G63_MAXFLICKER_P1,G63_MAXFREQUENCY_P1,G63_MAXFLICKER_P3,G63_MAXFREQUENCY_P3,G63_MAXFLICKER_P5,G63_MAXFREQUENCY_P5,G63_MAXFLICKER_P7,G63_MAXFREQUENCY_P7,G63_MAXFLICKER_P9,G63_MAXFREQUENCY_P9,G127_ODD_FLICKER12HZ_P1,G127_ODD_FLICKER12HZ_P3,G127_ODD_FLICKER12HZ_P5,G127_ODD_FLICKER12HZ_P7,G127_ODD_FLICKER12HZ_P9,G127_ODD_FLICKER24HZ_P1,G127_ODD_FLICKER24HZ_P3,G127_ODD_FLICKER24HZ_P5,G127_ODD_FLICKER24HZ_P7,G127_ODD_FLICKER24HZ_P9,G127_ODD_MAXFLICKER_P1,G127_ODD_MAXFREQUENCY_P1,G127_ODD_MAXFLICKER_P3,G127_ODD_MAXFREQUENCY_P3,G127_ODD_MAXFLICKER_P5,G127_ODD_MAXFREQUENCY_P5,G127_ODD_MAXFLICKER_P7,G127_ODD_MAXFREQUENCY_P7,G127_ODD_MAXFLICKER_P9,G127_ODD_MAXFREQUENCY_P9,G127_EVEN_FLICKER12HZ_P1,G127_EVEN_FLICKER12HZ_P3,G127_EVEN_FLICKER12HZ_P5,G127_EVEN_FLICKER12HZ_P7,G127_EVEN_FLICKER12HZ_P9,G127_EVEN_FLICKER24HZ_P1,G127_EVEN_FLICKER24HZ_P3,G127_EVEN_FLICKER24HZ_P5,G127_EVEN_FLICKER24HZ_P7,G127_EVEN_FLICKER24HZ_P9,G127_EVEN_MAXFLICKER_P1,G127_EVEN_MAXFREQUENCY_P1,G127_EVEN_MAXFLICKER_P3,G127_EVEN_MAXFREQUENCY_P3,G127_EVEN_MAXFLICKER_P5,G127_EVEN_MAXFREQUENCY_P5,G127_EVEN_MAXFLICKER_P7,G127_EVEN_MAXFREQUENCY_P7,G127_EVEN_MAXFLICKER_P9,G127_EVEN_MAXFREQUENCY_P9,G63_ODD_FLICKER12HZ_P1,G63_ODD_FLICKER12HZ_P3,G63_ODD_FLICKER12HZ_P5,G63_ODD_FLICKER12HZ_P7,G63_ODD_FLICKER12HZ_P9,G63_ODD_FLICKER24HZ_P1,G63_ODD_FLICKER24HZ_P3,G63_ODD_FLICKER24HZ_P5,G63_ODD_FLICKER24HZ_P7,G63_ODD_FLICKER24HZ_P9,G63_ODD_MAXFLICKER_P1,G63_ODD_MAXFREQUENCY_P1,G63_ODD_MAXFLICKER_P3,G63_ODD_MAXFREQUENCY_P3,G63_ODD_MAXFLICKER_P5,G63_ODD_MAXFREQUENCY_P5,G63_ODD_MAXFLICKER_P7,G63_ODD_MAXFREQUENCY_P7,G63_ODD_MAXFLICKER_P9,G63_ODD_MAXFREQUENCY_P9,G63_EVEN_FLICKER12HZ_P1,G63_EVEN_FLICKER12HZ_P3,G63_EVEN_FLICKER12HZ_P5,G63_EVEN_FLICKER12HZ_P7,G63_EVEN_FLICKER12HZ_P9,G63_EVEN_FLICKER24HZ_P1,G63_EVEN_FLICKER24HZ_P3,G63_EVEN_FLICKER24HZ_P5,G63_EVEN_FLICKER24HZ_P7,G127_FLICKER57HZ_P5,G127_FLICKER57HZ_P7,G127_FLICKER57HZ_P9,G127_FLICKER58HZ_P1,G127_FLICKER58HZ_P3,G127_FLICKER58HZ_P5,G127_FLICKER58HZ_P7,G127_FLICKER58HZ_P9,G127_FLICKER59HZ_P1,G127_FLICKER59HZ_P3,G127_FLICKER59HZ_P5,G127_FLICKER59HZ_P7,G127_FLICKER59HZ_P9,G127_FLICKER60HZ_P1,G127_FLICKER60HZ_P3,G127_FLICKER60HZ_P5,G127_FLICKER60HZ_P7,G127_FLICKER60HZ_P9,G127_FLICKER61HZ_P1,G127_FLICKER61HZ_P3,G127_FLICKER61HZ_P5,G127_FLICKER61HZ_P7,G127_FLICKER61HZ_P9,G127_FLICKER62HZ_P1,G127_FLICKER62HZ_P3,G127_FLICKER62HZ_P5,G127_FLICKER62HZ_P7,G127_FLICKER62HZ_P9,G127_FLICKER63HZ_P1,G127_FLICKER63HZ_P3,G127_FLICKER63HZ_P5,G127_FLICKER63HZ_P7,G127_FLICKER63HZ_P9,G127_FLICKER64HZ_P1,G127_FLICKER64HZ_P3,G127_FLICKER64HZ_P5,G127_FLICKER64HZ_P7,G127_FLICKER64HZ_P9,G127_MAXFLICKER_P1,G127_MAXFREQUENCY_P1,G127_MAXFLICKER_P3,G127_MAXFREQUENCY_P3,G127_MAXFLICKER_P5,G127_MAXFREQUENCY_P5,G127_MAXFLICKER_P7,G127_MAXFREQUENCY_P7,G127_MAXFLICKER_P9,G127_MAXFREQUENCY_P9,G63_FLICKER06HZ_P1,G63_FLICKER06HZ_P3,G63_FLICKER06HZ_P5,G63_FLICKER06HZ_P7,G63_FLICKER06HZ_P9,G63_FLICKER07HZ_P1,G63_FLICKER07HZ_P3,G63_FLICKER07HZ_P5,G63_FLICKER07HZ_P7,G63_FLICKER07HZ_P9,G63_FLICKER08HZ_P1,G63_FLICKER08HZ_P3,G63_FLICKER08HZ_P5,G63_FLICKER08HZ_P7,G63_FLICKER08HZ_P9,G63_FLICKER09HZ_P1,G63_FLICKER09HZ_P3,G63_FLICKER09HZ_P5,G63_FLICKER09HZ_P7,G63_FLICKER09HZ_P9,G63_FLICKER10HZ_P1,G63_FLICKER10HZ_P3,G63_FLICKER10HZ_P5,G63_FLICKER10HZ_P7,G63_FLICKER10HZ_P9,G63_FLICKER11HZ_P1,G63_FLICKER11HZ_P3,G63_FLICKER11HZ_P5,G63_FLICKER11HZ_P7,G63_FLICKER11HZ_P9,G63_FLICKER12HZ_P1,G63_FLICKER12HZ_P3,G63_FLICKER12HZ_P5,G63_FLICKER12HZ_P7,G63_FLICKER12HZ_P9,G63_FLICKER13HZ_P1,G63_FLICKER13HZ_P3,G63_FLICKER13HZ_P5,G63_FLICKER13HZ_P7,G63_FLICKER13HZ_P9,G63_FLICKER14HZ_P1,G63_FLICKER14HZ_P3,G63_FLICKER14HZ_P5,G63_FLICKER14HZ_P7,G63_FLICKER14HZ_P9,G63_FLICKER15HZ_P1,G63_FLICKER15HZ_P3,G63_FLICKER15HZ_P5,G63_FLICKER15HZ_P7,G63_FLICKER15HZ_P9,G63_FLICKER16HZ_P1,G63_FLICKER16HZ_P3,G63_FLICKER16HZ_P5,G63_FLICKER16HZ_P7,G63_FLICKER16HZ_P9,G63_FLICKER17HZ_P1,G63_FLICKER17HZ_P3,G63_FLICKER17HZ_P5,G63_FLICKER17HZ_P7,G63_FLICKER17HZ_P9,G63_FLICKER18HZ_P1,G63_FLICKER18HZ_P3,G63_FLICKER18HZ_P5,G63_FLICKER18HZ_P7,G63_FLICKER18HZ_P9,G63_FLICKER19HZ_P1,G63_FLICKER19HZ_P3,G63_FLICKER19HZ_P5,G63_FLICKER19HZ_P7,G63_FLICKER19HZ_P9,G63_FLICKER20HZ_P1,G63_FLICKER20HZ_P3,G63_FLICKER20HZ_P5,G63_FLICKER20HZ_P7,G63_FLICKER20HZ_P9,G63_FLICKER21HZ_P1,G63_FLICKER21HZ_P3,G63_FLICKER21HZ_P5,G63_FLICKER21HZ_P7,G63_FLICKER21HZ_P9,G63_FLICKER22HZ_P1,G63_FLICKER22HZ_P3,G63_FLICKER22HZ_P5,G63_FLICKER22HZ_P7,G63_FLICKER22HZ_P9,G63_FLICKER23HZ_P1,G63_FLICKER23HZ_P3,G63_FLICKER23HZ_P5,G63_FLICKER23HZ_P7,G63_FLICKER23HZ_P9,G63_FLICKER24HZ_P1,G63_FLICKER24HZ_P3,G63_FLICKER24HZ_P5,G63_FLICKER24HZ_P7,G63_FLICKER24HZ_P9,G63_FLICKER25HZ_P1,G63_FLICKER25HZ_P3,G63_FLICKER25HZ_P5,G63_FLICKER25HZ_P7,G63_FLICKER25HZ_P9,G63_FLICKER26HZ_P1,G63_FLICKER26HZ_P3,G63_FLICKER26HZ_P5,G63_FLICKER26HZ_P7,G63_FLICKER26HZ_P9,G63_FLICKER27HZ_P1,G63_FLICKER27HZ_P3,G63_FLICKER27HZ_P5,G63_FLICKER27HZ_P7,G63_FLICKER27HZ_P9,G63_FLICKER28HZ_P1,G63_FLICKER28HZ_P3,G63_FLICKER28HZ_P5,G63_FLICKER28HZ_P7,G63_FLICKER28HZ_P9,G63_FLICKER29HZ_P1,G63_FLICKER29HZ_P3,G63_FLICKER29HZ_P5,G63_FLICKER29HZ_P7,G63_FLICKER29HZ_P9,G63_FLICKER30HZ_P1,G63_FLICKER30HZ_P3,G63_FLICKER30HZ_P5,G63_FLICKER30HZ_P7,G63_FLICKER30HZ_P9,G63_FLICKER31HZ_P1,G63_FLICKER31HZ_P3,G63_FLICKER31HZ_P5,G63_FLICKER31HZ_P7,G63_FLICKER31HZ_P9,G63_FLICKER32HZ_P1,G63_FLICKER32HZ_P3,G63_FLICKER32HZ_P5,G63_FLICKER32HZ_P7,G63_FLICKER32HZ_P9,G63_FLICKER33HZ_P1,G63_FLICKER33HZ_P3,G63_FLICKER33HZ_P5,G63_FLICKER33HZ_P7,G63_FLICKER33HZ_P9,G63_FLICKER34HZ_P1,G63_FLICKER34HZ_P3,G63_FLICKER34HZ_P5,G63_FLICKER34HZ_P7,G63_FLICKER34HZ_P9,G63_FLICKER35HZ_P1,G63_FLICKER35HZ_P3,G63_FLICKER35HZ_P5,G63_FLICKER35HZ_P7,G63_FLICKER35HZ_P9,G63_FLICKER36HZ_P1,G63_FLICKER36HZ_P3,G63_FLICKER36HZ_P5,G63_FLICKER36HZ_P7,G63_FLICKER36HZ_P9,G63_FLICKER37HZ_P1,G63_FLICKER37HZ_P3,G63_FLICKER37HZ_P5,G63_FLICKER37HZ_P7,G63_FLICKER37HZ_P9,G63_FLICKER38HZ_P1,G63_FLICKER38HZ_P3,G63_FLICKER38HZ_P5,G63_FLICKER38HZ_P7,G63_FLICKER38HZ_P9,G127_FLICKER14HZ_P9,G127_FLICKER15HZ_P1,G127_FLICKER15HZ_P3,G127_FLICKER15HZ_P5,G127_FLICKER15HZ_P7,G127_FLICKER15HZ_P9,G127_FLICKER16HZ_P1,G127_FLICKER16HZ_P3,G127_FLICKER16HZ_P5,G127_FLICKER16HZ_P7,G127_FLICKER16HZ_P9,G127_FLICKER17HZ_P1,G127_FLICKER17HZ_P3,G127_FLICKER17HZ_P5,G127_FLICKER17HZ_P7,G127_FLICKER17HZ_P9,G127_FLICKER18HZ_P1,G127_FLICKER18HZ_P3,G127_FLICKER18HZ_P5,G127_FLICKER18HZ_P7,G127_FLICKER18HZ_P9,G127_FLICKER19HZ_P1,G127_FLICKER19HZ_P3,G127_FLICKER19HZ_P5,G127_FLICKER19HZ_P7,G127_FLICKER19HZ_P9,G127_FLICKER20HZ_P1,G127_FLICKER20HZ_P3,G127_FLICKER20HZ_P5,G127_FLICKER20HZ_P7,G127_FLICKER20HZ_P9,G127_FLICKER21HZ_P1,G127_FLICKER21HZ_P3,G127_FLICKER21HZ_P5,G127_FLICKER21HZ_P7,G127_FLICKER21HZ_P9,G127_FLICKER22HZ_P1,G127_FLICKER22HZ_P3,G127_FLICKER22HZ_P5,G127_FLICKER22HZ_P7,G127_FLICKER22HZ_P9,G127_FLICKER23HZ_P1,G127_FLICKER23HZ_P3,G127_FLICKER23HZ_P5,G127_FLICKER23HZ_P7,G127_FLICKER23HZ_P9,G127_FLICKER24HZ_P1,G127_FLICKER24HZ_P3,G127_FLICKER24HZ_P5,G127_FLICKER24HZ_P7,G127_FLICKER24HZ_P9,G127_FLICKER25HZ_P1,G127_FLICKER25HZ_P3,G127_FLICKER25HZ_P5,G127_FLICKER25HZ_P7,G127_FLICKER25HZ_P9,G127_FLICKER26HZ_P1,G127_FLICKER26HZ_P3,G127_FLICKER26HZ_P5,G127_FLICKER26HZ_P7,G127_FLICKER26HZ_P9,G127_FLICKER27HZ_P1,G127_FLICKER27HZ_P3,G127_FLICKER27HZ_P5,G127_FLICKER27HZ_P7,G127_FLICKER27HZ_P9,G127_FLICKER28HZ_P1,G127_FLICKER28HZ_P3,G127_FLICKER28HZ_P5,G127_FLICKER28HZ_P7,G127_FLICKER28HZ_P9,G127_FLICKER29HZ_P1,G127_FLICKER29HZ_P3,G127_FLICKER29HZ_P5,G127_FLICKER29HZ_P7,G127_FLICKER29HZ_P9,G127_FLICKER30HZ_P1,G127_FLICKER30HZ_P3,G127_FLICKER30HZ_P5,G127_FLICKER30HZ_P7,G127_FLICKER30HZ_P9,G127_FLICKER31HZ_P1,G127_FLICKER31HZ_P3,G127_FLICKER31HZ_P5,G127_FLICKER31HZ_P7,G127_FLICKER31HZ_P9,G127_FLICKER32HZ_P1,G127_FLICKER32HZ_P3,G127_FLICKER32HZ_P5,G127_FLICKER32HZ_P7,G127_FLICKER32HZ_P9,G127_FLICKER33HZ_P1,G127_FLICKER33HZ_P3,G127_FLICKER33HZ_P5,G127_FLICKER33HZ_P7,G127_FLICKER33HZ_P9,G127_FLICKER34HZ_P1,G127_FLICKER34HZ_P3,G127_FLICKER34HZ_P5,G127_FLICKER34HZ_P7,G127_FLICKER34HZ_P9,G127_FLICKER35HZ_P1,G127_FLICKER35HZ_P3,G127_FLICKER35HZ_P5,G127_FLICKER35HZ_P7,G127_FLICKER35HZ_P9,G127_FLICKER36HZ_P1,G127_FLICKER36HZ_P3,G127_FLICKER36HZ_P5,G127_FLICKER36HZ_P7,G127_FLICKER36HZ_P9,G127_FLICKER37HZ_P1,G127_FLICKER37HZ_P3,G127_FLICKER37HZ_P5,G127_FLICKER37HZ_P7,G127_FLICKER37HZ_P9,G127_FLICKER38HZ_P1,G127_FLICKER38HZ_P3,G127_FLICKER38HZ_P5,G127_FLICKER38HZ_P7,G127_FLICKER38HZ_P9,G127_FLICKER39HZ_P1,G127_FLICKER39HZ_P3,G127_FLICKER39HZ_P5,G127_FLICKER39HZ_P7,G127_FLICKER39HZ_P9,G127_FLICKER40HZ_P1,G127_FLICKER40HZ_P3,G127_FLICKER40HZ_P5,G127_FLICKER40HZ_P7,G127_FLICKER40HZ_P9,G127_FLICKER41HZ_P1,G127_FLICKER41HZ_P3,G127_FLICKER41HZ_P5,G127_FLICKER41HZ_P7,G127_FLICKER41HZ_P9,G127_FLICKER42HZ_P1,G127_FLICKER42HZ_P3,G127_FLICKER42HZ_P5,G127_FLICKER42HZ_P7,G127_FLICKER42HZ_P9,G127_FLICKER43HZ_P1,G127_FLICKER43HZ_P3,G127_FLICKER43HZ_P5,G127_FLICKER43HZ_P7,G127_FLICKER43HZ_P9,G127_FLICKER44HZ_P1,G127_FLICKER44HZ_P3,G127_FLICKER44HZ_P5,G127_FLICKER44HZ_P7,G127_FLICKER44HZ_P9,G127_FLICKER45HZ_P1,G127_FLICKER45HZ_P3,G127_FLICKER45HZ_P5,G127_FLICKER45HZ_P7,G127_FLICKER45HZ_P9,G127_FLICKER46HZ_P1,G127_FLICKER46HZ_P3,G127_FLICKER46HZ_P5,G127_FLICKER46HZ_P7,G127_FLICKER46HZ_P9,G127_FLICKER47HZ_P1,G127_FLICKER47HZ_P3,G127_FLICKER47HZ_P5,G127_FLICKER47HZ_P7,G127_FLICKER47HZ_P9,G127_FLICKER48HZ_P1,G127_FLICKER48HZ_P3,G127_FLICKER48HZ_P5,G127_FLICKER48HZ_P7,G127_FLICKER48HZ_P9,G127_FLICKER49HZ_P1,G127_FLICKER49HZ_P3,G127_FLICKER49HZ_P5,G127_FLICKER49HZ_P7,G127_FLICKER49HZ_P9,G127_FLICKER50HZ_P1,G127_FLICKER50HZ_P3,G127_FLICKER50HZ_P5,G127_FLICKER50HZ_P7,G127_FLICKER50HZ_P9,G127_FLICKER51HZ_P1,G127_FLICKER51HZ_P3,G127_FLICKER51HZ_P5,G127_FLICKER51HZ_P7,G127_FLICKER51HZ_P9,G127_FLICKER52HZ_P1,G127_FLICKER52HZ_P3,G127_FLICKER52HZ_P5,G127_FLICKER52HZ_P7,G127_FLICKER52HZ_P9,G127_FLICKER53HZ_P1,G127_FLICKER53HZ_P3,G127_FLICKER53HZ_P5,G127_FLICKER53HZ_P7,G127_FLICKER53HZ_P9,G127_FLICKER54HZ_P1,G127_FLICKER54HZ_P3,G127_FLICKER54HZ_P5,G127_FLICKER54HZ_P7,G127_FLICKER54HZ_P9,G127_FLICKER55HZ_P1,G127_FLICKER55HZ_P3,G127_FLICKER55HZ_P5,G127_FLICKER55HZ_P7,G127_FLICKER55HZ_P9,G127_FLICKER56HZ_P1,G127_FLICKER56HZ_P3,G127_FLICKER56HZ_P5,G127_FLICKER56HZ_P7,G127_FLICKER56HZ_P9,G127_FLICKER57HZ_P1,G127_FLICKER57HZ_P3,SERIALNUMBER,LCM_FULL_SN,STARTTIME,ENDTIME,STATIONID,SOFTWAREVERSION,STATUS,CAMERA_TYPE,FLICKER_TEST_VERSION,G127_FLICKER06HZ_P1,G127_FLICKER06HZ_P3,G127_FLICKER06HZ_P5,G127_FLICKER06HZ_P7,G127_FLICKER06HZ_P9,G127_FLICKER07HZ_P1,G127_FLICKER07HZ_P3,G127_FLICKER07HZ_P5,G127_FLICKER07HZ_P7,G127_FLICKER07HZ_P9,G127_FLICKER08HZ_P1,G127_FLICKER08HZ_P3,G127_FLICKER08HZ_P5,G127_FLICKER08HZ_P7,G127_FLICKER08HZ_P9,G127_FLICKER09HZ_P1,G127_FLICKER09HZ_P3,G127_FLICKER09HZ_P5,G127_FLICKER09HZ_P7,G127_FLICKER09HZ_P9,G127_FLICKER10HZ_P1,G127_FLICKER10HZ_P3,G127_FLICKER10HZ_P5,G127_FLICKER10HZ_P7,G127_FLICKER10HZ_P9,G127_FLICKER11HZ_P1,G127_FLICKER11HZ_P3,G127_FLICKER11HZ_P5,G127_FLICKER11HZ_P7,G127_FLICKER11HZ_P9,G127_FLICKER12HZ_P1,G127_FLICKER12HZ_P3,G127_FLICKER12HZ_P5,G127_FLICKER12HZ_P7,G127_FLICKER12HZ_P9,G127_FLICKER13HZ_P1,G127_FLICKER13HZ_P3,G127_FLICKER13HZ_P5,G127_FLICKER13HZ_P7,G127_FLICKER13HZ_P9,G127_FLICKER14HZ_P1,G127_FLICKER14HZ_P3,G127_FLICKER14HZ_P5,G127_FLICKER14HZ_P7) SELECT G63_EVEN_FLICKER24HZ_P9,G63_EVEN_MAXFLICKER_P1,G63_EVEN_MAXFREQUENCY_P1,G63_EVEN_MAXFLICKER_P3,G63_EVEN_MAXFREQUENCY_P3,G63_EVEN_MAXFLICKER_P5,G63_EVEN_MAXFREQUENCY_P5,G63_EVEN_MAXFLICKER_P7,G63_EVEN_MAXFREQUENCY_P7,G63_EVEN_MAXFLICKER_P9,G63_EVEN_MAXFREQUENCY_P9,I2C_DATA_COMPARE_RESULT,G63_FLICKER39HZ_P1,G63_FLICKER39HZ_P3,G63_FLICKER39HZ_P5,G63_FLICKER39HZ_P7,G63_FLICKER39HZ_P9,G63_FLICKER40HZ_P1,G63_FLICKER40HZ_P3,G63_FLICKER40HZ_P5,G63_FLICKER40HZ_P7,G63_FLICKER40HZ_P9,G63_FLICKER41HZ_P1,G63_FLICKER41HZ_P3,G63_FLICKER41HZ_P5,G63_FLICKER41HZ_P7,G63_FLICKER41HZ_P9,G63_FLICKER42HZ_P1,G63_FLICKER42HZ_P3,G63_FLICKER42HZ_P5,G63_FLICKER42HZ_P7,G63_FLICKER42HZ_P9,G63_FLICKER43HZ_P1,G63_FLICKER43HZ_P3,G63_FLICKER43HZ_P5,G63_FLICKER43HZ_P7,G63_FLICKER43HZ_P9,G63_FLICKER44HZ_P1,G63_FLICKER44HZ_P3,G63_FLICKER44HZ_P5,G63_FLICKER44HZ_P7,G63_FLICKER44HZ_P9,G63_FLICKER45HZ_P1,G63_FLICKER45HZ_P3,G63_FLICKER45HZ_P5,G63_FLICKER45HZ_P7,G63_FLICKER45HZ_P9,G63_FLICKER46HZ_P1,G63_FLICKER46HZ_P3,G63_FLICKER46HZ_P5,G63_FLICKER46HZ_P7,G63_FLICKER46HZ_P9,G63_FLICKER47HZ_P1,G63_FLICKER47HZ_P3,G63_FLICKER47HZ_P5,G63_FLICKER47HZ_P7,G63_FLICKER47HZ_P9,G63_FLICKER48HZ_P1,G63_FLICKER48HZ_P3,G63_FLICKER48HZ_P5,G63_FLICKER48HZ_P7,G63_FLICKER48HZ_P9,G63_FLICKER49HZ_P1,G63_FLICKER49HZ_P3,G63_FLICKER49HZ_P5,G63_FLICKER49HZ_P7,G63_FLICKER49HZ_P9,G63_FLICKER50HZ_P1,G63_FLICKER50HZ_P3,G63_FLICKER50HZ_P5,G63_FLICKER50HZ_P7,G63_FLICKER50HZ_P9,G63_FLICKER51HZ_P1,G63_FLICKER51HZ_P3,G63_FLICKER51HZ_P5,G63_FLICKER51HZ_P7,G63_FLICKER51HZ_P9,G63_FLICKER52HZ_P1,G63_FLICKER52HZ_P3,G63_FLICKER52HZ_P5,G63_FLICKER52HZ_P7,G63_FLICKER52HZ_P9,G63_FLICKER53HZ_P1,G63_FLICKER53HZ_P3,G63_FLICKER53HZ_P5,G63_FLICKER53HZ_P7,G63_FLICKER53HZ_P9,G63_FLICKER54HZ_P1,G63_FLICKER54HZ_P3,G63_FLICKER54HZ_P5,G63_FLICKER54HZ_P7,G63_FLICKER54HZ_P9,G63_FLICKER55HZ_P1,G63_FLICKER55HZ_P3,G63_FLICKER55HZ_P5,G63_FLICKER55HZ_P7,G63_FLICKER55HZ_P9,G63_FLICKER56HZ_P1,G63_FLICKER56HZ_P3,G63_FLICKER56HZ_P5,G63_FLICKER56HZ_P7,G63_FLICKER56HZ_P9,G63_FLICKER57HZ_P1,G63_FLICKER57HZ_P3,G63_FLICKER57HZ_P5,G63_FLICKER57HZ_P7,G63_FLICKER57HZ_P9,G63_FLICKER58HZ_P1,G63_FLICKER58HZ_P3,G63_FLICKER58HZ_P5,G63_FLICKER58HZ_P7,G63_FLICKER58HZ_P9,G63_FLICKER59HZ_P1,G63_FLICKER59HZ_P3,G63_FLICKER59HZ_P5,G63_FLICKER59HZ_P7,G63_FLICKER59HZ_P9,G63_FLICKER60HZ_P1,G63_FLICKER60HZ_P3,G63_FLICKER60HZ_P5,G63_FLICKER60HZ_P7,G63_FLICKER60HZ_P9,G63_FLICKER61HZ_P1,G63_FLICKER61HZ_P3,G63_FLICKER61HZ_P5,G63_FLICKER61HZ_P7,G63_FLICKER61HZ_P9,G63_FLICKER62HZ_P1,G63_FLICKER62HZ_P3,G63_FLICKER62HZ_P5,G63_FLICKER62HZ_P7,G63_FLICKER62HZ_P9,G63_FLICKER63HZ_P1,G63_FLICKER63HZ_P3,G63_FLICKER63HZ_P5,G63_FLICKER63HZ_P7,G63_FLICKER63HZ_P9,G63_FLICKER64HZ_P1,G63_FLICKER64HZ_P3,G63_FLICKER64HZ_P5,G63_FLICKER64HZ_P7,G63_FLICKER64HZ_P9,G63_MAXFLICKER_P1,G63_MAXFREQUENCY_P1,G63_MAXFLICKER_P3,G63_MAXFREQUENCY_P3,G63_MAXFLICKER_P5,G63_MAXFREQUENCY_P5,G63_MAXFLICKER_P7,G63_MAXFREQUENCY_P7,G63_MAXFLICKER_P9,G63_MAXFREQUENCY_P9,G127_ODD_FLICKER12HZ_P1,G127_ODD_FLICKER12HZ_P3,G127_ODD_FLICKER12HZ_P5,G127_ODD_FLICKER12HZ_P7,G127_ODD_FLICKER12HZ_P9,G127_ODD_FLICKER24HZ_P1,G127_ODD_FLICKER24HZ_P3,G127_ODD_FLICKER24HZ_P5,G127_ODD_FLICKER24HZ_P7,G127_ODD_FLICKER24HZ_P9,G127_ODD_MAXFLICKER_P1,G127_ODD_MAXFREQUENCY_P1,G127_ODD_MAXFLICKER_P3,G127_ODD_MAXFREQUENCY_P3,G127_ODD_MAXFLICKER_P5,G127_ODD_MAXFREQUENCY_P5,G127_ODD_MAXFLICKER_P7,G127_ODD_MAXFREQUENCY_P7,G127_ODD_MAXFLICKER_P9,G127_ODD_MAXFREQUENCY_P9,G127_EVEN_FLICKER12HZ_P1,G127_EVEN_FLICKER12HZ_P3,G127_EVEN_FLICKER12HZ_P5,G127_EVEN_FLICKER12HZ_P7,G127_EVEN_FLICKER12HZ_P9,G127_EVEN_FLICKER24HZ_P1,G127_EVEN_FLICKER24HZ_P3,G127_EVEN_FLICKER24HZ_P5,G127_EVEN_FLICKER24HZ_P7,G127_EVEN_FLICKER24HZ_P9,G127_EVEN_MAXFLICKER_P1,G127_EVEN_MAXFREQUENCY_P1,G127_EVEN_MAXFLICKER_P3,G127_EVEN_MAXFREQUENCY_P3,G127_EVEN_MAXFLICKER_P5,G127_EVEN_MAXFREQUENCY_P5,G127_EVEN_MAXFLICKER_P7,G127_EVEN_MAXFREQUENCY_P7,G127_EVEN_MAXFLICKER_P9,G127_EVEN_MAXFREQUENCY_P9,G63_ODD_FLICKER12HZ_P1,G63_ODD_FLICKER12HZ_P3,G63_ODD_FLICKER12HZ_P5,G63_ODD_FLICKER12HZ_P7,G63_ODD_FLICKER12HZ_P9,G63_ODD_FLICKER24HZ_P1,G63_ODD_FLICKER24HZ_P3,G63_ODD_FLICKER24HZ_P5,G63_ODD_FLICKER24HZ_P7,G63_ODD_FLICKER24HZ_P9,G63_ODD_MAXFLICKER_P1,G63_ODD_MAXFREQUENCY_P1,G63_ODD_MAXFLICKER_P3,G63_ODD_MAXFREQUENCY_P3,G63_ODD_MAXFLICKER_P5,G63_ODD_MAXFREQUENCY_P5,G63_ODD_MAXFLICKER_P7,G63_ODD_MAXFREQUENCY_P7,G63_ODD_MAXFLICKER_P9,G63_ODD_MAXFREQUENCY_P9,G63_EVEN_FLICKER12HZ_P1,G63_EVEN_FLICKER12HZ_P3,G63_EVEN_FLICKER12HZ_P5,G63_EVEN_FLICKER12HZ_P7,G63_EVEN_FLICKER12HZ_P9,G63_EVEN_FLICKER24HZ_P1,G63_EVEN_FLICKER24HZ_P3,G63_EVEN_FLICKER24HZ_P5,G63_EVEN_FLICKER24HZ_P7,G127_FLICKER57HZ_P5,G127_FLICKER57HZ_P7,G127_FLICKER57HZ_P9,G127_FLICKER58HZ_P1,G127_FLICKER58HZ_P3,G127_FLICKER58HZ_P5,G127_FLICKER58HZ_P7,G127_FLICKER58HZ_P9,G127_FLICKER59HZ_P1,G127_FLICKER59HZ_P3,G127_FLICKER59HZ_P5,G127_FLICKER59HZ_P7,G127_FLICKER59HZ_P9,G127_FLICKER60HZ_P1,G127_FLICKER60HZ_P3,G127_FLICKER60HZ_P5,G127_FLICKER60HZ_P7,G127_FLICKER60HZ_P9,G127_FLICKER61HZ_P1,G127_FLICKER61HZ_P3,G127_FLICKER61HZ_P5,G127_FLICKER61HZ_P7,G127_FLICKER61HZ_P9,G127_FLICKER62HZ_P1,G127_FLICKER62HZ_P3,G127_FLICKER62HZ_P5,G127_FLICKER62HZ_P7,G127_FLICKER62HZ_P9,G127_FLICKER63HZ_P1,G127_FLICKER63HZ_P3,G127_FLICKER63HZ_P5,G127_FLICKER63HZ_P7,G127_FLICKER63HZ_P9,G127_FLICKER64HZ_P1,G127_FLICKER64HZ_P3,G127_FLICKER64HZ_P5,G127_FLICKER64HZ_P7,G127_FLICKER64HZ_P9,G127_MAXFLICKER_P1,G127_MAXFREQUENCY_P1,G127_MAXFLICKER_P3,G127_MAXFREQUENCY_P3,G127_MAXFLICKER_P5,G127_MAXFREQUENCY_P5,G127_MAXFLICKER_P7,G127_MAXFREQUENCY_P7,G127_MAXFLICKER_P9,G127_MAXFREQUENCY_P9,G63_FLICKER06HZ_P1,G63_FLICKER06HZ_P3,G63_FLICKER06HZ_P5,G63_FLICKER06HZ_P7,G63_FLICKER06HZ_P9,G63_FLICKER07HZ_P1,G63_FLICKER07HZ_P3,G63_FLICKER07HZ_P5,G63_FLICKER07HZ_P7,G63_FLICKER07HZ_P9,G63_FLICKER08HZ_P1,G63_FLICKER08HZ_P3,G63_FLICKER08HZ_P5,G63_FLICKER08HZ_P7,G63_FLICKER08HZ_P9,G63_FLICKER09HZ_P1,G63_FLICKER09HZ_P3,G63_FLICKER09HZ_P5,G63_FLICKER09HZ_P7,G63_FLICKER09HZ_P9,G63_FLICKER10HZ_P1,G63_FLICKER10HZ_P3,G63_FLICKER10HZ_P5,G63_FLICKER10HZ_P7,G63_FLICKER10HZ_P9,G63_FLICKER11HZ_P1,G63_FLICKER11HZ_P3,G63_FLICKER11HZ_P5,G63_FLICKER11HZ_P7,G63_FLICKER11HZ_P9,G63_FLICKER12HZ_P1,G63_FLICKER12HZ_P3,G63_FLICKER12HZ_P5,G63_FLICKER12HZ_P7,G63_FLICKER12HZ_P9,G63_FLICKER13HZ_P1,G63_FLICKER13HZ_P3,G63_FLICKER13HZ_P5,G63_FLICKER13HZ_P7,G63_FLICKER13HZ_P9,G63_FLICKER14HZ_P1,G63_FLICKER14HZ_P3,G63_FLICKER14HZ_P5,G63_FLICKER14HZ_P7,G63_FLICKER14HZ_P9,G63_FLICKER15HZ_P1,G63_FLICKER15HZ_P3,G63_FLICKER15HZ_P5,G63_FLICKER15HZ_P7,G63_FLICKER15HZ_P9,G63_FLICKER16HZ_P1,G63_FLICKER16HZ_P3,G63_FLICKER16HZ_P5,G63_FLICKER16HZ_P7,G63_FLICKER16HZ_P9,G63_FLICKER17HZ_P1,G63_FLICKER17HZ_P3,G63_FLICKER17HZ_P5,G63_FLICKER17HZ_P7,G63_FLICKER17HZ_P9,G63_FLICKER18HZ_P1,G63_FLICKER18HZ_P3,G63_FLICKER18HZ_P5,G63_FLICKER18HZ_P7,G63_FLICKER18HZ_P9,G63_FLICKER19HZ_P1,G63_FLICKER19HZ_P3,G63_FLICKER19HZ_P5,G63_FLICKER19HZ_P7,G63_FLICKER19HZ_P9,G63_FLICKER20HZ_P1,G63_FLICKER20HZ_P3,G63_FLICKER20HZ_P5,G63_FLICKER20HZ_P7,G63_FLICKER20HZ_P9,G63_FLICKER21HZ_P1,G63_FLICKER21HZ_P3,G63_FLICKER21HZ_P5,G63_FLICKER21HZ_P7,G63_FLICKER21HZ_P9,G63_FLICKER22HZ_P1,G63_FLICKER22HZ_P3,G63_FLICKER22HZ_P5,G63_FLICKER22HZ_P7,G63_FLICKER22HZ_P9,G63_FLICKER23HZ_P1,G63_FLICKER23HZ_P3,G63_FLICKER23HZ_P5,G63_FLICKER23HZ_P7,G63_FLICKER23HZ_P9,G63_FLICKER24HZ_P1,G63_FLICKER24HZ_P3,G63_FLICKER24HZ_P5,G63_FLICKER24HZ_P7,G63_FLICKER24HZ_P9,G63_FLICKER25HZ_P1,G63_FLICKER25HZ_P3,G63_FLICKER25HZ_P5,G63_FLICKER25HZ_P7,G63_FLICKER25HZ_P9,G63_FLICKER26HZ_P1,G63_FLICKER26HZ_P3,G63_FLICKER26HZ_P5,G63_FLICKER26HZ_P7,G63_FLICKER26HZ_P9,G63_FLICKER27HZ_P1,G63_FLICKER27HZ_P3,G63_FLICKER27HZ_P5,G63_FLICKER27HZ_P7,G63_FLICKER27HZ_P9,G63_FLICKER28HZ_P1,G63_FLICKER28HZ_P3,G63_FLICKER28HZ_P5,G63_FLICKER28HZ_P7,G63_FLICKER28HZ_P9,G63_FLICKER29HZ_P1,G63_FLICKER29HZ_P3,G63_FLICKER29HZ_P5,G63_FLICKER29HZ_P7,G63_FLICKER29HZ_P9,G63_FLICKER30HZ_P1,G63_FLICKER30HZ_P3,G63_FLICKER30HZ_P5,G63_FLICKER30HZ_P7,G63_FLICKER30HZ_P9,G63_FLICKER31HZ_P1,G63_FLICKER31HZ_P3,G63_FLICKER31HZ_P5,G63_FLICKER31HZ_P7,G63_FLICKER31HZ_P9,G63_FLICKER32HZ_P1,G63_FLICKER32HZ_P3,G63_FLICKER32HZ_P5,G63_FLICKER32HZ_P7,G63_FLICKER32HZ_P9,G63_FLICKER33HZ_P1,G63_FLICKER33HZ_P3,G63_FLICKER33HZ_P5,G63_FLICKER33HZ_P7,G63_FLICKER33HZ_P9,G63_FLICKER34HZ_P1,G63_FLICKER34HZ_P3,G63_FLICKER34HZ_P5,G63_FLICKER34HZ_P7,G63_FLICKER34HZ_P9,G63_FLICKER35HZ_P1,G63_FLICKER35HZ_P3,G63_FLICKER35HZ_P5,G63_FLICKER35HZ_P7,G63_FLICKER35HZ_P9,G63_FLICKER36HZ_P1,G63_FLICKER36HZ_P3,G63_FLICKER36HZ_P5,G63_FLICKER36HZ_P7,G63_FLICKER36HZ_P9,G63_FLICKER37HZ_P1,G63_FLICKER37HZ_P3,G63_FLICKER37HZ_P5,G63_FLICKER37HZ_P7,G63_FLICKER37HZ_P9,G63_FLICKER38HZ_P1,G63_FLICKER38HZ_P3,G63_FLICKER38HZ_P5,G63_FLICKER38HZ_P7,G63_FLICKER38HZ_P9,G127_FLICKER14HZ_P9,G127_FLICKER15HZ_P1,G127_FLICKER15HZ_P3,G127_FLICKER15HZ_P5,G127_FLICKER15HZ_P7,G127_FLICKER15HZ_P9,G127_FLICKER16HZ_P1,G127_FLICKER16HZ_P3,G127_FLICKER16HZ_P5,G127_FLICKER16HZ_P7,G127_FLICKER16HZ_P9,G127_FLICKER17HZ_P1,G127_FLICKER17HZ_P3,G127_FLICKER17HZ_P5,G127_FLICKER17HZ_P7,G127_FLICKER17HZ_P9,G127_FLICKER18HZ_P1,G127_FLICKER18HZ_P3,G127_FLICKER18HZ_P5,G127_FLICKER18HZ_P7,G127_FLICKER18HZ_P9,G127_FLICKER19HZ_P1,G127_FLICKER19HZ_P3,G127_FLICKER19HZ_P5,G127_FLICKER19HZ_P7,G127_FLICKER19HZ_P9,G127_FLICKER20HZ_P1,G127_FLICKER20HZ_P3,G127_FLICKER20HZ_P5,G127_FLICKER20HZ_P7,G127_FLICKER20HZ_P9,G127_FLICKER21HZ_P1,G127_FLICKER21HZ_P3,G127_FLICKER21HZ_P5,G127_FLICKER21HZ_P7,G127_FLICKER21HZ_P9,G127_FLICKER22HZ_P1,G127_FLICKER22HZ_P3,G127_FLICKER22HZ_P5,G127_FLICKER22HZ_P7,G127_FLICKER22HZ_P9,G127_FLICKER23HZ_P1,G127_FLICKER23HZ_P3,G127_FLICKER23HZ_P5,G127_FLICKER23HZ_P7,G127_FLICKER23HZ_P9,G127_FLICKER24HZ_P1,G127_FLICKER24HZ_P3,G127_FLICKER24HZ_P5,G127_FLICKER24HZ_P7,G127_FLICKER24HZ_P9,G127_FLICKER25HZ_P1,G127_FLICKER25HZ_P3,G127_FLICKER25HZ_P5,G127_FLICKER25HZ_P7,G127_FLICKER25HZ_P9,G127_FLICKER26HZ_P1,G127_FLICKER26HZ_P3,G127_FLICKER26HZ_P5,G127_FLICKER26HZ_P7,G127_FLICKER26HZ_P9,G127_FLICKER27HZ_P1,G127_FLICKER27HZ_P3,G127_FLICKER27HZ_P5,G127_FLICKER27HZ_P7,G127_FLICKER27HZ_P9,G127_FLICKER28HZ_P1,G127_FLICKER28HZ_P3,G127_FLICKER28HZ_P5,G127_FLICKER28HZ_P7,G127_FLICKER28HZ_P9,G127_FLICKER29HZ_P1,G127_FLICKER29HZ_P3,G127_FLICKER29HZ_P5,G127_FLICKER29HZ_P7,G127_FLICKER29HZ_P9,G127_FLICKER30HZ_P1,G127_FLICKER30HZ_P3,G127_FLICKER30HZ_P5,G127_FLICKER30HZ_P7,G127_FLICKER30HZ_P9,G127_FLICKER31HZ_P1,G127_FLICKER31HZ_P3,G127_FLICKER31HZ_P5,G127_FLICKER31HZ_P7,G127_FLICKER31HZ_P9,G127_FLICKER32HZ_P1,G127_FLICKER32HZ_P3,G127_FLICKER32HZ_P5,G127_FLICKER32HZ_P7,G127_FLICKER32HZ_P9,G127_FLICKER33HZ_P1,G127_FLICKER33HZ_P3,G127_FLICKER33HZ_P5,G127_FLICKER33HZ_P7,G127_FLICKER33HZ_P9,G127_FLICKER34HZ_P1,G127_FLICKER34HZ_P3,G127_FLICKER34HZ_P5,G127_FLICKER34HZ_P7,G127_FLICKER34HZ_P9,G127_FLICKER35HZ_P1,G127_FLICKER35HZ_P3,G127_FLICKER35HZ_P5,G127_FLICKER35HZ_P7,G127_FLICKER35HZ_P9,G127_FLICKER36HZ_P1,G127_FLICKER36HZ_P3,G127_FLICKER36HZ_P5,G127_FLICKER36HZ_P7,G127_FLICKER36HZ_P9,G127_FLICKER37HZ_P1,G127_FLICKER37HZ_P3,G127_FLICKER37HZ_P5,G127_FLICKER37HZ_P7,G127_FLICKER37HZ_P9,G127_FLICKER38HZ_P1,G127_FLICKER38HZ_P3,G127_FLICKER38HZ_P5,G127_FLICKER38HZ_P7,G127_FLICKER38HZ_P9,G127_FLICKER39HZ_P1,G127_FLICKER39HZ_P3,G127_FLICKER39HZ_P5,G127_FLICKER39HZ_P7,G127_FLICKER39HZ_P9,G127_FLICKER40HZ_P1,G127_FLICKER40HZ_P3,G127_FLICKER40HZ_P5,G127_FLICKER40HZ_P7,G127_FLICKER40HZ_P9,G127_FLICKER41HZ_P1,G127_FLICKER41HZ_P3,G127_FLICKER41HZ_P5,G127_FLICKER41HZ_P7,G127_FLICKER41HZ_P9,G127_FLICKER42HZ_P1,G127_FLICKER42HZ_P3,G127_FLICKER42HZ_P5,G127_FLICKER42HZ_P7,G127_FLICKER42HZ_P9,G127_FLICKER43HZ_P1,G127_FLICKER43HZ_P3,G127_FLICKER43HZ_P5,G127_FLICKER43HZ_P7,G127_FLICKER43HZ_P9,G127_FLICKER44HZ_P1,G127_FLICKER44HZ_P3,G127_FLICKER44HZ_P5,G127_FLICKER44HZ_P7,G127_FLICKER44HZ_P9,G127_FLICKER45HZ_P1,G127_FLICKER45HZ_P3,G127_FLICKER45HZ_P5,G127_FLICKER45HZ_P7,G127_FLICKER45HZ_P9,G127_FLICKER46HZ_P1,G127_FLICKER46HZ_P3,G127_FLICKER46HZ_P5,G127_FLICKER46HZ_P7,G127_FLICKER46HZ_P9,G127_FLICKER47HZ_P1,G127_FLICKER47HZ_P3,G127_FLICKER47HZ_P5,G127_FLICKER47HZ_P7,G127_FLICKER47HZ_P9,G127_FLICKER48HZ_P1,G127_FLICKER48HZ_P3,G127_FLICKER48HZ_P5,G127_FLICKER48HZ_P7,G127_FLICKER48HZ_P9,G127_FLICKER49HZ_P1,G127_FLICKER49HZ_P3,G127_FLICKER49HZ_P5,G127_FLICKER49HZ_P7,G127_FLICKER49HZ_P9,G127_FLICKER50HZ_P1,G127_FLICKER50HZ_P3,G127_FLICKER50HZ_P5,G127_FLICKER50HZ_P7,G127_FLICKER50HZ_P9,G127_FLICKER51HZ_P1,G127_FLICKER51HZ_P3,G127_FLICKER51HZ_P5,G127_FLICKER51HZ_P7,G127_FLICKER51HZ_P9,G127_FLICKER52HZ_P1,G127_FLICKER52HZ_P3,G127_FLICKER52HZ_P5,G127_FLICKER52HZ_P7,G127_FLICKER52HZ_P9,G127_FLICKER53HZ_P1,G127_FLICKER53HZ_P3,G127_FLICKER53HZ_P5,G127_FLICKER53HZ_P7,G127_FLICKER53HZ_P9,G127_FLICKER54HZ_P1,G127_FLICKER54HZ_P3,G127_FLICKER54HZ_P5,G127_FLICKER54HZ_P7,G127_FLICKER54HZ_P9,G127_FLICKER55HZ_P1,G127_FLICKER55HZ_P3,G127_FLICKER55HZ_P5,G127_FLICKER55HZ_P7,G127_FLICKER55HZ_P9,G127_FLICKER56HZ_P1,G127_FLICKER56HZ_P3,G127_FLICKER56HZ_P5,G127_FLICKER56HZ_P7,G127_FLICKER56HZ_P9,G127_FLICKER57HZ_P1,G127_FLICKER57HZ_P3,SERIALNUMBER,LCM_FULL_SN,STARTTIME,ENDTIME,STATIONID,SOFTWAREVERSION,STATUS,CAMERA_TYPE,FLICKER_TEST_VERSION,G127_FLICKER06HZ_P1,G127_FLICKER06HZ_P3,G127_FLICKER06HZ_P5,G127_FLICKER06HZ_P7,G127_FLICKER06HZ_P9,G127_FLICKER07HZ_P1,G127_FLICKER07HZ_P3,G127_FLICKER07HZ_P5,G127_FLICKER07HZ_P7,G127_FLICKER07HZ_P9,G127_FLICKER08HZ_P1,G127_FLICKER08HZ_P3,G127_FLICKER08HZ_P5,G127_FLICKER08HZ_P7,G127_FLICKER08HZ_P9,G127_FLICKER09HZ_P1,G127_FLICKER09HZ_P3,G127_FLICKER09HZ_P5,G127_FLICKER09HZ_P7,G127_FLICKER09HZ_P9,G127_FLICKER10HZ_P1,G127_FLICKER10HZ_P3,G127_FLICKER10HZ_P5,G127_FLICKER10HZ_P7,G127_FLICKER10HZ_P9,G127_FLICKER11HZ_P1,G127_FLICKER11HZ_P3,G127_FLICKER11HZ_P5,G127_FLICKER11HZ_P7,G127_FLICKER11HZ_P9,G127_FLICKER12HZ_P1,G127_FLICKER12HZ_P3,G127_FLICKER12HZ_P5,G127_FLICKER12HZ_P7,G127_FLICKER12HZ_P9,G127_FLICKER13HZ_P1,G127_FLICKER13HZ_P3,G127_FLICKER13HZ_P5,G127_FLICKER13HZ_P7,G127_FLICKER13HZ_P9,G127_FLICKER14HZ_P1,G127_FLICKER14HZ_P3,G127_FLICKER14HZ_P5,G127_FLICKER14HZ_P7 FROM PANDA_DATA_X1047_MAIN WHERE ENDTIME > START_TIME AND ENDTIME < END_TIME;
COMMIT;
-- 查詢當天去重复所有的70碼以及20碼
for i in (SELECT DISTINCT(LCM_FULL_SN) LCM_FULL_SN,SUBSTR(LOTNAME, 0, 20) LOTNAME FROM X1047_DATA_AABCLOGIC_MAIN P,LAM_C_SN L WHERE P.LCM_FULL_SN=L.NGLOTNAME AND P.ENDTIME > END_DTIME AND P.ENDTIME < END_TIME)
loop
SELECT COUNT(*) into M_COUNT FROM LAM_C_MACHINETESTHISTORY WHERE lotname = i.LOTNAME AND AreaNAME = 'G18-5F-OpticaI Test' AND TIMEKEY > START_TIMEKEY AND TIMEKEY < END_TIMEKEY ORDER BY TIMEKEY DESC;
IF M_COUNT<=4 AND M_COUNT>0 THEN
for j in (SELECT TO_CHAR(TO_DATE(SUBSTR (TIMEKEY, 1, 14),'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd hh24:mi:ss' ) TIMEKEY FROM LAM_C_MACHINETESTHISTORY WHERE lotname = i.LOTNAME AND AreaNAME = 'G18-5F-OpticaI Test' AND TIMEKEY > START_TIMEKEY AND TIMEKEY < END_TIMEKEY ORDER BY TIMEKEY DESC)
loop
for item in ( SELECT /*+RULE*/ LCM_FULL_SN,STARTTIME,ENDTIME,STATIONID,SOFTWAREVERSION,STATUS FROM X1047_DATA_AABCLOGIC_MAIN A WHERE ISDELETE IS NULL AND A .ENDTIME > START_TIME AND A .ENDTIME < END_TIME AND A.LCM_FULL_SN = i.LCM_FULL_SN AND ABS (
TO_DATE (A .ENDTIME,'yyyy-MM-dd hh24:mi:ss') - TO_DATE (j.TIMEKEY,'yyyy-MM-dd hh24:mi:ss')) = (SELECT MIN(ABS (TO_DATE (A .ENDTIME,'yyyy-MM-dd hh24:mi:ss') - TO_DATE (j.TIMEKEY,'yyyy-MM-dd hh24:mi:ss'))
) AS tm1 FROM X1047_DATA_AABCLOGIC_MAIN A WHERE ISDELETE IS NULL AND LCM_FULL_SN = i.LCM_FULL_SN) )
loop
UPDATE X1047_DATA_AABCLOGIC_MAIN SET ISDELETE='Y' WHERE LCM_FULL_SN=item.LCM_FULL_SN AND STARTTIME=item.STARTTIME AND ENDTIME=item.ENDTIME AND STATIONID=item.STATIONID AND SOFTWAREVERSION=item.SOFTWAREVERSION AND STATUS=item.STATUS;
COMMIT;
end loop;
end loop;
ELSIF M_COUNT>4 THEN
for j in (SELECT TIMEKEY FROM (SELECT TO_CHAR(TO_DATE(SUBSTR (TIMEKEY, 1, 14),'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd hh24:mi:ss') TIMEKEY FROM LAM_C_MACHINETESTHISTORY WHERE lotname = i.LOTNAME AND AreaNAME = 'G18-5F-OpticaI Test' AND TIMEKEY > START_TIMEKEY AND TIMEKEY < END_TIMEKEY ORDER BY TIMEKEY DESC) WHERE ROWNUM<=4 )
loop
for item in ( SELECT /*+RULE*/ LCM_FULL_SN,STARTTIME,ENDTIME,STATIONID,SOFTWAREVERSION,STATUS FROM X1047_DATA_AABCLOGIC_MAIN A WHERE ISDELETE IS NULL AND A .ENDTIME > START_TIME AND A .ENDTIME < END_TIME AND A.LCM_FULL_SN = i.LCM_FULL_SN AND ABS (
TO_DATE (A .ENDTIME,'yyyy-MM-dd hh24:mi:ss') - TO_DATE ( j.TIMEKEY,'yyyy-MM-dd hh24:mi:ss') ) = (SELECT MIN(ABS (TO_DATE (A .ENDTIME,'yyyy-MM-dd hh24:mi:ss') - TO_DATE ( j.TIMEKEY ,'yyyy-MM-dd hh24:mi:ss') )
) AS tm1 FROM X1047_DATA_AABCLOGIC_MAIN A WHERE ISDELETE IS NULL AND LCM_FULL_SN = i.LCM_FULL_SN) )
loop
UPDATE X1047_DATA_AABCLOGIC_MAIN SET ISDELETE='Y' WHERE LCM_FULL_SN=item.LCM_FULL_SN AND STARTTIME=item.STARTTIME AND ENDTIME=item.ENDTIME AND STATIONID=item.STATIONID AND SOFTWAREVERSION=item.SOFTWAREVERSION AND STATUS=item.STATUS;
COMMIT;
end loop;
end loop;
ELSE
UPDATE X1047_DATA_AABCLOGIC_MAIN SET ISDELETE='N' WHERE LCM_FULL_SN=i.LCM_FULL_SN AND ENDTIME > END_DTIME AND ENDTIME < END_TIME;
COMMIT;
END IF;
end loop;
END IF;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
--ROLLBACK;
MODELNAMEI:=dbms_utility.format_error_backtrace();
RETURN_CODE := SQLCODE;
RETURN_SQL := SQLERRM;
V_TIMEKEY := TO_CHAR(SYSTIMESTAMP, 'YYYYMMDDHH24MISSFF6');
INSERT INTO Z_ERROR (TIMEKEY, PROCNAME, ERRNUM, ERRMSG, MARK)
VALUES(V_TIMEKEY,'PTSMGR.UPD_X1047_DATA_AABCLOGIC_MAIN',RETURN_CODE,RETURN_SQL,MODELNAMEI);
COMMIT;
END UPD_PANDA_DATA_AABCLOGIC_MAIN;