Oracle PL/SQL:将整行从触发器转发到过程

2023-11-28数据库问题
4

本文介绍了Oracle PL/SQL:将整行从触发器转发到过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

有一个 Oracle (10i) PL/SQL 行级触发器,它负责三个独立的任务.由于触发器在这种情况下相对混乱,我想将这三个任务导出到三个存储过程中.我正在考虑使用 my_table%ROWTYPE 参数或过程的集合类型,但我主要关心的是如何填充这些参数.

In have an Oracle (10i) PL/SQL Row-Level trigger which is responsible for three independent tasks. As the trigger is relatively cluttered that way, I want to export these three tasks into three stored procedures. I was thinking of using a my_table%ROWTYPE parameter or maybe a collection type for the procedures, but my main concern is how to fill these parameters.

有没有办法轻松地将触发器的整个 :NEW 行放入单个变量中?到目前为止,我能找到的唯一方法是将每个字段单独分配给不太令人满意的变量,查看代码维护等.

Is there a way to put the whole :NEW row of a trigger into a single variable easily? So far the only way I could find out was assigning each field separately to the variable which is not quite satisfying, looking at code maintenance etc.

类似的东西

SELECT :NEW.* INTO <variable> FROM dual;

将是首选.(实际上我还没有尝试过,但我想它不会起作用)

would be preferred. (I haven't tried that actually but I suppose it wouldn't work)

推荐答案

这不可能.

也许 我对另一个问题的回答 可以提供帮助.

Maybe my answer to another question can help.

这篇关于Oracle PL/SQL:将整行从触发器转发到过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同
Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)...
2024-04-16 数据库问题
13

创建分层定义的数据集的扁平表/视图
Creating a flattened table/view of a hierarchically-defined set of data(创建分层定义的数据集的扁平表/视图)...
2024-04-16 数据库问题
4

MySQL:如何做到行级安全(如 Oracle 的 Virtual Private Database)?
MySQL: how to do row-level security (like Oracle#39;s Virtual Private Database)?(MySQL:如何做到行级安全(如 Oracle 的 Virtual Private Database)?)...
2024-04-16 数据库问题
6

强制执行具有完整性约束的“子集"关系的最佳方法是什么
What is the best way to enforce a #39;subset#39; relationship with integrity constraints(强制执行具有完整性约束的“子集关系的最佳方法是什么)...
2024-04-16 数据库问题
7

使用 oracle SQL 按分隔符位置拆分字符串
Split String by delimiter position using oracle SQL(使用 oracle SQL 按分隔符位置拆分字符串)...
2024-04-16 数据库问题
46

如何根据列的值展开Oracle查询的结果
How to unfold the results of an Oracle query based on the value of a column(如何根据列的值展开Oracle查询的结果)...
2024-04-16 数据库问题
8