将计算列添加到临时 table Oracle

Add computed column to temporary table Oracle

我想在 Oracle 中将计算列添加到全局临时 table。 对于简单的 tables,请求运行良好。

alter table ma_table add ma_column as (column1*column2);

但临时的拒绝使用as。 有没有办法将新的计算列添加到 Oracle 中的临时 table?

错误消息非常明确。 ORA-54010: expression column is not supported for a temporary table.

the "alter table ma_table add ma_column;" works well when the "as" is there the request is rejected.

AS 是创建虚拟列所必需的语法。但不是语法而是动作。本documentation is quite clear上:

"You can create virtual columns only in relational heap tables. Virtual columns are not supported for index-organized, external, object, cluster, or temporary tables."

在这种情况下,平台的限制胜过您的项目要求。

我刚找到方法, 我添加了带有 alter request

的列
alter table ma_table add ma_column [type];

然后创建一个脚本,在执行插入请求时执行更新请求

update ma_table set ma_column=(colonne1*colonne2);