在将数据加载到Teradata数据库之前,如何检查和处理单位中的数据? [英] How do I check and manipulate the data from a flat before loading them to teradata database?

查看:97
本文介绍了在将数据加载到Teradata数据库之前,如何检查和处理单位中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为主题,在使用BTEQ脚本将平面文件中的数据加载到teradata数据库之前,我该如何对其进行操作...
我不确定应该将该操作写到bteq脚本中的哪一部分。 ...

As the topic, how do I manipulate the data from the flat file before loading them onto teradata database using BTEQ script.... I'm unsure which part should the manipulation be written onto the bteq script....

                  USING
 ------------------------------------------------------
                 INSERT INTO
 ------------------------------------------------------
                  Values
  In my opinion, data manipulation should be done here
  ------------------------------------------------------

  Table Name : Jerry
    A
  -------
  | 5   |          
  | 6   |          
  | 7   |          
  -------

Values in the data file,
   00005|Jim
   0    |Apple
        |Loop

条件:

从数据文件中读取数据。第一列为0或NULL的行不应加载,也应在加载到表中之前执行前导0。..

The data is read from the data file. The row whose first column is 0 or NULL should not be loaded, also the leading 0 should be executed before loading into the table........

Guess:

VALUES 
(
 IF TRIM(LEADING '0' FROM :A) != NULL OR IF TRIM(LEADING '0' FROM :A) != 0
 THEN TRIM(LEADING '0' FROM :A)
,B
,C



 );


推荐答案

请不要bteq进行加载。

Please don't bteq for loading. This was never the intention of this tool.

对于条件加载,可以在APPLY语句中将条件放入MLoad中。与当前的加载工具TPT相同。在TPT中,它是从何处插入选择。此外,您可以混合使用Load(加载或更新-Operator)&一个TPT脚本中的DML(DDL运算符)。

For conditional Loading, you can put criteria in MLoad in the APPLY Statement. Same to the current tool for loading, TPT. In TPT it's "INSERT INTO SELECT from where ". In addition you can mix Load (Load or Update -Operator) & DML (DDL Operator) in one TPT -script.

这篇关于在将数据加载到Teradata数据库之前,如何检查和处理单位中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆