我的表格如下:
+-------------------+
|Name |
+-------------------+
|Name1 |
|Name2 |
|Name3 |
|Name1Jr |
|Name2Jr |
|Name3Jr |
+-------------------+
我的多行块看起来像:
我想知道的是在插入名称后如何插入与Jr具有相同名称的记录。例如,我插入了Name2,它也会将Name2Jr插入到multirow块中。像这样:
我尝试了后记录触发器:
insert tbl.name into name
from table tbl
where tbl.name = name||'Jr.'
注意: 我需要从数据库中获取自动插入数据的值。
答案 0 :(得分:1)
这是一个选项。
创建块级WHEN-NEW-RECORD-INSTANCE
触发器:
if :system.trigger_record = 1 and :test.name is null then
-- do nothing if it is the first record in a form
null;
else
duplicate_record;
if substr(:test.name, -2) = 'Jr' then
-- you've duplicated a record which already has 'Jr' at the end - don't do it
:test.name := null;
else
-- concatenate 'Jr' to the duplicated record
:test.name := :test.name || 'Jr';
end if;
end if;
运行表单