字段总数不能超过一个值

时间:2018-09-18 19:01:23

标签: oracle oracle11g oracle-apex

我如何告诉oracle apex一个字段(个人)的总和不能超过5(5是该字段的总数)。因此,举例来说,某人最多可能需要花费5个私人日,但除了必须休假外,不能超过该天

1 个答案:

答案 0 :(得分:0)

Here's one option:

  • create a function (which accepts person's ID) and returns total number of personal days (that would be a simple SELECT statement with a SUM function) and - probably - a WHERE clause that restricts rows to ... what? The last year?
  • on Apex page, create a validation for item you use to enter number of personal days; its type would be a PL/SQL Function which returns error text, and checks whether number of entered personal days + total number of personal days (so far) (returned by a function) exceeds 5 days. If so, display an error.