Here is an introduction to the six Teradata Utilities starting. be able to do much else. directly into any Teradata SQL using the INSERT, UPDATE or. In a BTEQ we have 2 insert 2 del 2 update statment. when the BTEQ is restarted i need to run the BTEQ from after DEL statment(means no need to run the insert & del. I have a table test having columns id which primary key and auto incremented and name. I want to insert a new record if annd only if there are no records.For example. Use update first as given below checking on primary key column for existing one which is coming with updates. UPDATE PRD_MAIN_SRV_DX_x. FROM PRD_MAIN_SRV_DXS B. PRD_MAIN_IDN = B. PRD_MAIN_IDN. FRU_FLG = B. FRU_FLG. WHERE PRD_MAIN_SRV_DX_x. PRD_MAIN_IDN = B. PRD_MAIN_IDN. Then use insert for new records applying where clause to find whether its exist or not.
If not insert it. INSERT INTO PRD_MAIN_SRV_DX_x (. PRD_MAIN_IDN ? FROM PRD_MAIN_SRV_DXS A. LEFT OUTER JOIN PRD_MAIN_SRV_DX_x B. ON A. PRD_MAIN_IDN = B. PRD_MAIN_IDN. WHERE B. PRD_MAIN_IDN IS NULL. Hope this will help in performing both insert and update simultaneously in one bteq.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
October 2017
Categories |