Teradata 易失性表语句未创建任何行 [英] Teradata Volatile Table Statement is not creating any rows
本文介绍了Teradata 易失性表语句未创建任何行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在 Teradata 中创建表.因此我使用这种语法:
I want to create table in Teradata. Therefore I am using this syntax:
CREATE VOLATILE TABLE a AS
(
Select * FROM ...
) WITH DATA PRIMARY INDEX ( ACCOUNT_ID )
;
内部 SELECT 语句产生 4 行.但是,当我运行整个查询时,结果数据集没有任何行.奇怪,我知道——这就是我写作的原因.请帮忙.谢谢.
The inner SELECT statement results in 4 rows. However, when I run the entire query, the resulting data set does not have any rows. Strange, I know - that`s why I'm writing. Please help. Thanks.
推荐答案
你需要在你的 DDL 中包含 ON COMMIT PRESERVE ROWS
选项,用于易失性表:
You need to include the ON COMMIT PRESERVE ROWS
option with your DDL for the volatile table:
CREATE VOLATILE TABLE a AS
(
Select * FROM ...
) WITH DATA
PRIMARY INDEX ( ACCOUNT_ID )
ON COMMIT PRESERVE ROWS;
易失性(和全局临时)表的默认COMMIT
模式是在事务结束时DELETE
行.
The default COMMIT
mode for volatile (and global temporary) tables is to DELETE
the rows at the end of the transaction.
这篇关于Teradata 易失性表语句未创建任何行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文