在 Teradata 中使用查找列表(使用 Teradata SQL 助手)

Using lookup list in Teradata (Using Teradata SQL Assistant)

我是 Teradata 的新手。我有一个包含数百万条记录的 table,我正在尝试使用查找列表基于子集进行查询以提供我的 where 子句。
我的查找列表包含数千条记录。

在 SQL 助手中这是我试过的:

SELECT  T.*
FROM a_balance T
JOIN
    OPENROWSET (
             BULK 'c:\myfile.txt',
             FORMATFILE = 'c:\myfileformat.txt'
    ) B ON T.accountID  = B.accountID

您建议在 Teradata SQL Assistant 中做什么?

正如@denoeth 所建议的那样-
您可以创建一个 volatile table.
(我仍然建议您要一个 scratch/playground 数据库)

VOLATILE
...The definition is of a volatile table is retained in memory only for the duration of the session in which it is defined. Space usage is charged to the login user spool space. Because volatile tables are private to the session that creates them, the system does not check the creation, access, modification, and drop privileges. A single session can materialize up to 1,000 volatile tables.

SQL Data Definition Language Syntax and Examples Release 15.10 B035-1144-151K June 2015


使用 Teradata 导入 SQL Assistant
(适用于相对较小的数据集)

"Tools" -> "Options" -> "Import"

set/unset "Ignore the first record in the import file (Skip Header)"
将 "Maximum Batch size for simple import" 设置为 999

create volatile set table accounts (accountID int) 
unique primary index (accountID) 
on commit preserve rows
;

"File" -> "Import Data"

insert into accounts (accountID) values (?);

"File" -> "Import Data" (cancel selection)