if v_test_id IS NOT NULL AND exists (select test_id from physicians where test_id = v_test_id) then
select 'phys_id' = -1;
elseif
if v_addl_language1 = '' THEN SELECT v_addl_language1 = NULL;
if v_addl_language2 = '' THEN SELECT v_addl_language2 = NULL;
if v_addl_language3 = '' THEN SELECT v_addl_language3 = NULL;
如果v_addl_language1 ...
发生错误我已经在if语句的参数周围添加了括号,但似乎没有修复它。有什么想法吗?
答案 0 :(得分:0)
你错过END IF;每个IF的声明
sintaxe是IF表达式THEN命令; ELSEIF anotherExpression THEN命令; ELSE命令;结束如果;
所以elseif
部分的代码应为:
ELSEIF someexpression THEN
if v_addl_language1 = '' THEN SELECT v_addl_language1 = NULL; end if;
if v_addl_language2 = '' THEN SELECT v_addl_language2 = NULL; end if;
if v_addl_language3 = '' THEN SELECT v_addl_language3 = NULL; end if;
END IF;