![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Database-Based Authentication for PHP Apps | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 02:10 AM |
| ccall database and collect data from one table | rinku | Shell Programming and Scripting | 0 | 05-27-2007 10:16 PM |
| Upload of the images from the folder to the Database table | shashisaini24 | UNIX for Advanced & Expert Users | 0 | 11-29-2006 02:03 AM |
| how to insert data in database based on text file? | forevercalz | Shell Programming and Scripting | 9 | 12-20-2005 07:40 PM |
| export table from oracle database | inquirer | Shell Programming and Scripting | 1 | 06-24-2003 06:48 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Delete database table based on months using script.
HI All,
Newbie here. I have a script which generates the tables in teradata database with time stamp like below.I want to add some more code to delete the archive tables which are 2months old. . $HOME/.profile t_name=$1 procdate=`date +%y%m%d` log_dir=$Folder/log tab=`echo $t_name"_"$procdate` tab_create=$log_dir/$t_name.txt param_dir=$Folder/parameter echo ".run file=$param_dir/logon.txt;" > $tab_create echo "DATABASE XYZ;" >> $tab_create echo ".echoreq off;" >>$tab_create echo ".SET FOLDLINE off; " >>$tab_create echo "rename table $t_name to $tab;" >> $tab_create echo ".if errorcode =3803 then .goto prob38;" >> $tab_create echo "create table $t_name as $tab with no data;" >> $tab_create echo ".quit;" >> $tab_create echo ".LABEL prob38" >> $tab_create echo "drop table $tab;" >> $tab_create echo "rename table $t_name to $tab;" >> $tab_create echo "create table $t_name as $tab with no data;" >> $tab_create echo ".quit;" >> $tab_create echo "EOF" >> $tab_create bteq < $tab_create> $log_dir/$tab_create_$tab.log Can someone help me on this.. Thanks. Regards, Mav. |
|||
| Google UNIX.COM |
| Forum Sponsor | ||
|
|