Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sat, 20 May 2007 @ 00:10:19 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Is there any command on BTEQ to drop a file
 
From:   McCall, Glenn David

I'm not sure what you mean by "drop a file". You seem to be mixing terminology. Do you mean drop a table or delete a file? Anyway read on I'm sure you will see the answer below.

Bteq is about submitting SQL to Teradata for processing. It can also be used to import / export data and a few other things.

It is not about scheduling activity. What you would do is build a bteq script which might be a job in itself or part of a larger job. The job is scheduled using a job scheduler such as cron on Unix, "Schedule task" on Windows, or a commercial package such as control-M.

Having said that, to drop a table you simply include the appropriate query in your bteq script. Specifically: "drop table some_table;".

If you wanted to delete a file (e.g. some_file.txt) you would do this in either:

1) the larger job, of which your bteq script is a part. Specifically: "del some_file.txt" on windows or "rm some_file.txt" on Unix.

2) within the bteq script using the .os command. Specifically ".os del some_file.txt" if bteq is running on windows or ".os rm some_file.txt" if bteq is running on Unix.


You can do the same thing on a mainframe, but I'm not familiar with the appropriate mainframe commands.

Your question seems to be about deleting files on a regular basis not about running SQL. Why would you just want to delete files from within bteq?


Regards

Glenn Mc



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023