Running Teradata Script in Unix

General
Enthusiast

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?

3 REPLIES
Enthusiast

Re: Running Teradata Script in Unix

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.

Enthusiast

Re: Running Teradata Script in Unix

Thanks for your help Raja.

And one more clarification is it possible to write this in TDSQL?

Enthusiast

Re: Running Teradata Script in Unix

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_24...