How do I check and manipulate the data from a flat before loading them to teradata database?

大城市里の小女人 提交于 2020-04-18 06:53:48

问题


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

Condition:

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



 );

回答1:


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

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.



来源:https://stackoverflow.com/questions/60540302/how-do-i-check-and-manipulate-the-data-from-a-flat-before-loading-them-to-terada

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!