Oracle Apex 互动网格日期验证

huangapple go评论101阅读模式
英文:

Oracle Apex Interactive Grid Validation with Dates

问题

我在我的页面上有一个非常简单的 IG:

CREATE TABLE my_table (id number, date_from date, date_to date)

IG 可编辑(从 my_table 中选择所有 3 列),用户可以编辑两个日期字段。

我正在尝试为日期创建验证(函数体返回错误文本):

begin
    if TO_DATE(:date_from, 'MM/DD/YYYY') > TO_DATE(:date_to, 'MM/DD/YYYY') then return 'To date must be prior From date';
    else null;
    end if;
end;

(所有关于验证的选项都没有被修改)

验证没有起作用,不确定为什么。

有人可以帮忙吗?

谢谢

英文:

I have a really simple IG on my page:

CREATE TABLE my_table (id number, date_from date, date_to date)

IG is editable (selecting all 3 columns from my_table) and users are able to edit both date fields.
I'm trying to create a validation for the dates (function body returning error text):

begin

if TO_DATE(:date_from, 'MM/DD/YYYY') > TO_DATE(:date_to, 'MM/DD/YYYY') then return 
'To date must be prior From date';
else null;
end if;
 
end;

(all options on said validations haven't been modified)
Validation is not doing anything, not sure why.
Anybody can help?

Thanks

答案1

得分: 1

这是在apex.oracle.com上的Apex 23.1.1版本。我创建了一个基于示例表格的交互式网格。

  • 日期格式为dd.mm.yyyy。
  • 验证设置为日期列,一个返回错误文本的函数体:
return case when :date_from > :date_to then
              'To date must be prior From date'
       end;

执行的效果如下:

Oracle Apex 互动网格日期验证

英文:

This is Apex 23.1.1 on apex.oracle.com. I created sample table and interactive grid based on it.

  • dates are in dd.mm.yyyy format

  • validation is set to date to column, a function body that returns error text:

    return case when :date_from > :date_to then
                  'To date must be prior From date'
           end;
    

This is how execution looks like:

Oracle Apex 互动网格日期验证

huangapple
  • 本文由 发表于 2023年6月29日 03:53:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76576320.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定