SQL assistant vs BTEQ
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.

««12

SQL assistant vs BTEQ Expand / Collapse
Author
Message
Posted 9/20/2007 2:05:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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

Post #8959
Posted 9/22/2007 12:34:23 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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
Post #8984
Posted 10/18/2007 3:19:57 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum 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
Post #9286
Posted 10/18/2007 8:02:49 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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
Post #9291
Posted 10/18/2007 8:07:14 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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
Post #9292
Posted 11/9/2007 3:21:07 PM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum 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
Post #9675
Posted 7/1/2009 5:34:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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 :-).
Post #15976
Posted 7/15/2009 8:11:58 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum 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
Post #16196
« Prev Topic | Next Topic »

««12

Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 2:00am

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.063. 9 queries. Compression Disabled.