Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Bulk Loading - response (1) by msk.khurram

$
0
0

You can use the following code to genrate ID column. Although the use of CSUM function is discouraged now.

INSERT   INTO Target_Table_name
(
INDEX_COLUMN
--Other_Column_list
)
SELECT 
,System_Generated_Id
FROM
(
    SELECT
    (CSUM(1, 1) + MAX_INDEX_COLUMN_VALUE) AS System_Generated_Id
    --OTHER_COLUMN_LIST
	FROM
        TABLENAME,
		(
		SELECT
			MAX(INDEX_COLUMN)
		FROM
			Target_Table_name
		)
		MAX_INDEX(MAX_INDEX_COLUMN_VALUE) 
)
;

Hope it will help you!
 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>