0

Hi need help with below requirement.

In Teradata, I have a set of SQL scripts which have to run one after the another. Then once running of them is done, the data has to be stored in a file based on the run date.I have to automate them so the same work triggers once everyday and data get stored in new folder/file with date included in the name.

Ex: after running of the scripts one after the another, finally one table is created that table has to be stored as tableYYYYMMDD. The scripts has to run everyday and a new table has to be created or else there should be only one table and data needs to appended to it everyday.

Vishnu
  • 11
  • 6
  • Post the code you have written so far!! – Rahul Agarwal Dec 02 '18 at 06:20
  • Hi Rahul cannot share the SQL scripts. Those are the basically the staging tables and end is the final table. – Vishnu Dec 02 '18 at 18:38
  • 1
    To get help from the folks here...you have to show the effort and work done by you!! – Rahul Agarwal Dec 02 '18 at 20:04
  • You can certainly mock-up some pseudo-code to demonstrate what you have tried or where you are getting tripped up. It’s certainly feasible to accomplish what you are looking to do but we don’t want to start from scratch. – Rob Paller Dec 03 '18 at 03:25
  • hi tarun, to get help help from your friends here u need to give them a baseline to help you out, for example a pseudo table structure, code you have written so far, the scheduler you are using, what are the interfaces available to you, for example do you want to write the wrapper scripts for running the sqls in a shell script or a python script ,where exactly are you facing the issue etc. – Aritra Bhattacharya Dec 03 '18 at 04:39
  • Below is the code: .SET SESSION TRANSACTION ANSI .SET FORMAT ON .SET INDICDATA OFF .LABEL selecting_activity DATABASE ; .EXPORT DATA FILE = c:C:\Users\user_name\Documents\export.csv; .SET SEPARATOR ',' SELECT TOP 10 UID, Fn_name, Ln_name FROM .; .IF ERRORCODE <> 0 THEN .EXIT ERRORCODE; .SET FORMAT OFF I want the script in such a way that it should print the table values in one excel sheet and log file in separate file may be log.txt. Is there any automation option available in Teradata. – Vishnu Dec 03 '18 at 23:16

0 Answers0