Oracle PL/SQL有错ORA-06550请高手指教
请高手帮忙看下面代码有什么问题:declareV_FEEDER_NOVARCHAR2(25);V_WORK_TIMEDATE;CURSORFIND_WORK_TIMEIS...
请高手帮忙看下面代码有什么问题:
declare
V_FEEDER_NO VARCHAR2(25);
V_WORK_TIME DATE;
CURSOR FIND_WORK_TIME IS
(SELECT FEEDER_NO,max(WORK_TIME)
FROM SFISM4.R_SMT_LOG_T
WHERE PRODUCT_NO = '43Y9240' AND
MACHINE_CODE = 'S907ACM402-4' AND
FEEDER_NO IN(SELECT FEEDER_NO
FROM SFIS1.C_SMT_BOM_T
WHERE BOM_NO IN (
SELECT BOM_NO
FROM SFISM4.R_SMT_PROD_BOM_T
WHERE PRODUCT_NO = '43Y9240' AND LINE_NAME= 'SMT907A')
AND
MACHINE_CODE ='S907ACM402-4' AND FEEDER_NO >='000'
AND FEEDER_NO <='300' AND
FEEDER_NO NOT IN (
SELECT DISTINCT FEEDER_NO
FROM SFISM4.R_SMT_LOG_T
WHERE PRODUCT_NO= '43Y9240' AND
MACHINE_CODE = 'S907ACM402-4' AND
SYSDATE >= WORK_TIME AND SYSDATE <= END_TIME))
GROUP BY FEEDER_NO);
begin
OPEN FIND_WORK_TIME;
LOOP
FETCH FEEDER_NO INTO V_FEEDER_NO;
FETCH WORK_TIME INTO V_WORK_TIME;
EXIT WHEN FIND_WORK_TIME %NOTFOUND;
SELECT *
FROM SFISM4.R_SMT_LOG_T
WHERE PRODUCT_NO = '43Y9240' AND
MACHINE_CODE = 'S907ACM402-4' AND
WORK_TIME =V_WORK_TIME AND FEEDER_NO =V_FEEDER_NO;
END LOOP;
END
dyxg041 -我那是返回两个值啊。。。。你在看下... 展开
declare
V_FEEDER_NO VARCHAR2(25);
V_WORK_TIME DATE;
CURSOR FIND_WORK_TIME IS
(SELECT FEEDER_NO,max(WORK_TIME)
FROM SFISM4.R_SMT_LOG_T
WHERE PRODUCT_NO = '43Y9240' AND
MACHINE_CODE = 'S907ACM402-4' AND
FEEDER_NO IN(SELECT FEEDER_NO
FROM SFIS1.C_SMT_BOM_T
WHERE BOM_NO IN (
SELECT BOM_NO
FROM SFISM4.R_SMT_PROD_BOM_T
WHERE PRODUCT_NO = '43Y9240' AND LINE_NAME= 'SMT907A')
AND
MACHINE_CODE ='S907ACM402-4' AND FEEDER_NO >='000'
AND FEEDER_NO <='300' AND
FEEDER_NO NOT IN (
SELECT DISTINCT FEEDER_NO
FROM SFISM4.R_SMT_LOG_T
WHERE PRODUCT_NO= '43Y9240' AND
MACHINE_CODE = 'S907ACM402-4' AND
SYSDATE >= WORK_TIME AND SYSDATE <= END_TIME))
GROUP BY FEEDER_NO);
begin
OPEN FIND_WORK_TIME;
LOOP
FETCH FEEDER_NO INTO V_FEEDER_NO;
FETCH WORK_TIME INTO V_WORK_TIME;
EXIT WHEN FIND_WORK_TIME %NOTFOUND;
SELECT *
FROM SFISM4.R_SMT_LOG_T
WHERE PRODUCT_NO = '43Y9240' AND
MACHINE_CODE = 'S907ACM402-4' AND
WORK_TIME =V_WORK_TIME AND FEEDER_NO =V_FEEDER_NO;
END LOOP;
END
dyxg041 -我那是返回两个值啊。。。。你在看下... 展开
2个回答
展开全部
CURSOR FIND_WORK_TIME is SELECT FEEDER_NO,max(WORK_TIME) FROM
查询的时候是两个值,赋值的时候只有一个变量
FETCH WORK_TIME INTO V_WORK_TIME;
查询的时候是两个值,赋值的时候只有一个变量
FETCH WORK_TIME INTO V_WORK_TIME;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-10-05
展开全部
abap4 exponent用法
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询