我想要一个这样的查询:
if ((select closedatetime from tbl_eventschedularmaster where eventid=p_EventId)> sysdate)
then
update tbL_ANSWERMASTER set AnsText=p_AnsText
where AnsId=p_checkduplicate RETURNING AnsId INTO p_ReturnVal;
else
RETURNING 0 INTO p_ReturnVal;
end if
但它不起作用
答案 0 :(得分:1)
您需要重新编写
select closedatetime
into dtClosedDateTime
from tbl_eventschedularmaster
where eventid = p_EventId;
if dtClosedDateTime > sysdate then
update tbL_ANSWERMASTER
set AnsText=p_AnsText
where AnsId=p_checkduplicate
RETURNING AnsId INTO p_ReturnVal;
else
p_ReturnVal := 0;
end if;
分享并享受。