All Forums General
Vinay151 20 posts Joined 12/14
18 Dec 2014
Running Teradata Script in Unix

Hi,
   I'm new to Teradata. We can run the Netezza SQL in Unix by using "nzsql" command.
nzsql -host hostname -u username -pw password -db Databasename -c "select * from table_name"
What is the command like this, so that we could use to run Teradata SQL in Unix?
 

Raja_KT 1246 posts Joined 07/09
18 Dec 2014

Example of bteq script from the documentation:

#!/bin/sh

#########################################

bteq <<EOI

export DATADIR=/datasvc/data

.LOGON mydbs/myid,mypw;

.EXPORT REPORT FILE=$DATADIR/output

SELECT * from table_name;

.EXPORT RESET

.LOGOFF

.EXIT

EOI

#########################################

 

Teradata has many utilities like mload,fastexport,fastload.... and so you can invoke in similar way.

 

You can specify lots of format options in Teradata(import,export, load, unload..) whereas very less in Netezza.

 

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

Vinay151 20 posts Joined 12/14
18 Dec 2014

Thanks for your help Raja.
And one more clarification is it possible to write this in TDSQL?

Raja_KT 1246 posts Joined 07/09
18 Dec 2014

I m not sure about your question. Since it is NZSQL for you and you made it TDSQL I think. The above script is just an example I highlighted. There are other ways too. We can do in interactive and batch mode.
You can try login to TD  bteq say , supplying username, password.  For Oracle, SQL server, sybase.... the ways are different for each DB.
 
Maybe you can read the manual or broswe this link and give you an insight :
http://www.info.teradata.com/htmlpubs/DB_TTU_14_00/index.html#page/Load_and_Unload_Utilities/B035_2414_071A/2414ch03.014.01.html

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

You must sign in to leave a comment.