|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 9/21/2007 12:07:00 AM
Posts: 1,
Visits: 1
|
|
I have just started to write script.
need help.
1. I created a script in teradata. " select count(distinct medtd_service_no), net_Used, dlvry_tchnlgy_cd from MEDIATED_CALL_HIST where medtd_call_start_dt between date - 7 and date - 1 and net_Used in ('GS' , '3G' ) and dlvry_tchnlgy_cd in ('VC', 'SM', 'VI') group by 2,3 order by net_Used,dlvry_tchnlgy_cd;" 2. I would like to schedule this script? 3.How do I do this? 4. do i need create a bat file? how do I create / write? 5. where do i include my login details? 6. Like to have an output file as well?
dm
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 9/8/2009 8:51:09 AM
Posts: 126,
Visits: 79
|
|
is there any difference in collecting statistics between SQl Assistant and BTEQ
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2/18/2008 3:41:20 AM
Posts: 26,
Visits: 230
|
|
Hi friends.
Thaks for all I cleared max doubts of giving replys.
can u any one give the simple script for BTEQ and tell me how to execute that script, tell me step by step.
Thaks and Regards
Anil Reddy
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 1/28/2008 8:40:36 AM
Posts: 5,
Visits: 10
|
|
Hi DM,
Yes, you can do all of that using BTEQ.
1.To run your script in BTEQ, your should first put it in a file and save it as
It can be run from the UNIX/LINUX prompt as
$ bteq < file_name.bteq
This will invoke the script in bteq
2.I am not very sure scheduling in BTEQ, but you can use a unix shell wrapper around your script to schedule it
3.There is no need to create a BAT file. a UNIX shell would suffice.
4.You can put your logon details in the following format in beginning your script file.
.logon TDPID/USERNAME,PASSWD;
5.The output can be had by redirecting :
$ bteq log
Hope these things would help
Regards,
Rayravi
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 1/28/2008 8:40:36 AM
Posts: 5,
Visits: 10
|
|
Hi Job_Agent,
There is no difference of where you do COLLECT STATS . It serves the same purpose as in BTEQ and SQL assistant.
P.S. BTEQ may be slightly faster as it is CLI than an ODBC, if you are working in a big Client-server network. Again here I am just guessing*
Regards,
Rayravi
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 8/21/2009 1:38:02 PM
Posts: 41,
Visits: 88
|
|
Boy is that an understatement. In almost every instance we have run, BTEQ is much faster than SQL Assistant. I'm not sure why, but I would think that using native CLIv2 would incur less overhead than ODBC/OLE DB.
R
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 7/1/2009 5:40:07 AM
Posts: 4,
Visits: 10
|
|
Hi, you can execute SQL scripts using BTEQ this way:
1st file (BTEQ.bat) contains:
---------------------------
"c:\Program Files\NCR\Teradata Client\bin\bteq.exe" ( "SCRIPT_NAME.txt" ) "SCRIPT_NAME.log"
-- instead of () use <>, for some reason this forum deletes that part of the string if i use <>
2nd file (SCRIPT_NAME.txt) that is executed looks like this:
--------------------------------------------------------
.SET SESSION CHARSET 'CHARSET_NAME'
.SET WIDTH 130;
.SET ERRORLEVEL UNKNOWN SEVERITY 16;
.SET ERROROUT STDOUT;
.SET MAXERROR 1
-- either calls logon script or looks like
.LOGON DATABASE_CONNECTION_STRING/USER_NAME,PASSWORD;
-- main SQL logic is here (inserts, deletes, updates..)
.IF ERRORCODE > 0 THEN .QUIT 8;
.QUIT 0
Hope that helps :-).
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 10/22/2009 1:29:06 AM
Posts: 36,
Visits: 182
|
|
Most of the work I do is in unix platform(bteq,mload,tpump,fastload). In bteq we can conveniently put our programming
in unix environment and it looks good. In windows platform I dont appreciate it since I cannot play much with the quality
delivery.
Thanks and regards,
Raja K Thaw
Teradata_cert_Oracle_cert
|
|
|
|