Archives of the TeradataForum
Message Posted: Wed, 11 Oct 2006 @ 17:04:54 GMT
We are doing an upgrade in the next few weeks and would like to automate some of our validation scripts. What we want to do is create a table that has DatabaseName, TableName and row counts in it.
We have created SQL to generate the insert select statement with the count(*) etc. see below. When we generate a file from this SQL using a fast export the file is about Char(200) in length. What we want to do is generate the SQL, Fast Export it to a file and run the exported file to populate a results table. Unfortunately the Mainframe only lets us use DML scripts of 80.
I know that Carriage Return in both ASCII and EBCDIC in hex is 0D, is there any way that we put this carriage return into our fast export so our file will be less that 80 chars in length.
If you can help us this will save us a load of work!
SELECT 'INSERT INTO NEW_BOX_ROW_COUNT (DB_NAME,TAB_NAME,ROW_COUNT)' ||'SELECT ' || '''' || DB_NAME || '''' || ',' || '''' || trim(TAB_NAME) || '''' ||',COUNT(*) FROM '||DB_NAME||'.'||trim(TAB_NAME)||' GROUP BY 1,2;' FROM TABLE_DRIVER;
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|