我已在应用程序中为文本字段创建了验证。 文本字段是"位置。"它具有唯一约束,当您输入现有位置时,它将为您提供ORA错误消息。而不是这个,我想显示一个字段内联错误消息。 我做了以下。
这正是我想要的,但是当我尝试创建一个新位置时,它也会给我这个错误消息。我能做些什么只影响已经存在的位置?
答案 0 :(得分:1)
好吧,你从来没有真正控制你现在输入的位置是否已经存在于表格中。
我建议如下:
PL / SQL函数体:
declare
l_loc your_table.location%type;
begin
select location
into l_loc
from your_table
where location = :P3_LOCATION;
return ('Location already exists');
exception
when no_data_found then null;
end;
显示位置:内联字段