0
我已经写含有像一个while语句一个PostgreSQL功能:验证一个布尔条件的函数内部
WHILE id_exist == 'f' LOOP
lotto_id = lotto_id + 1;
id_exist = check_if_exist(lotto_id, 'lotto', 'id');
END LOOP;
凡id_exist
是通过调用check_if_exist()
方法初始化的布尔变量(也用于内部,而代码),该返回的布尔值。
现在,当我尝试打电话给我的功能,我得到这个错误
ERROR: operator does not exist: boolean == unknown
LINE 1: SELECT id_exist == 'f'
^
HINT: No operator matches the given name and argument type(s). You might need to add
explicit type casts.
QUERY: SELECT id_exist == 'f'
CONTEXT: PL/pgSQL function "acquistolotto" line 11 at WHILE
好的,没错。但是现在我有一个无限循环问题。我会打开另一个问题。谢谢 当然,我已经设置该值调用check_if_exist()函数,而 – giozh
如果是这样的话,它看起来像你的check_if_exist()函数总是返回“false”。先看看那个。 – Curt