how to execute bteq on vmaware with linux os

Teradata Database on VMWare
Enthusiast

how to execute bteq on vmaware with linux os

hi

i've installed teradata on vmware on linux os? can someone help me to how to execute bteq scripts?

 

thanks.

1 REPLY
Teradata Employee

Re: how to execute bteq on vmaware with linux os

You may need to clarify what scripts you are trying to run but maybe one of these examples will help you:

1. how to login to bteq and run a script from bteq. Below I call a script that resides in /tmp/tmp1 file on the node I ran bteq from:

# bteq

 Teradata BTEQ 14.10.00.11 for LINUX. PID: 19673

 Copyright 1984-2014, Teradata Corporation. ALL RIGHTS RESERVED.

 Enter your logon or BTEQ command:

.logon dbc

.logon dbc

Password:

 *** Logon successfully completed.

 *** Teradata Database Release is 14.10.07.05                  

 *** Teradata Database Version is 14.10.07.04                    

 *** Transaction Semantics are BTET.

 *** Session Character Set Name is 'ASCII'.

 *** Total elapsed time was 1 second.

 BTEQ -- Enter your SQL request or BTEQ command:

.run file=/tmp/tmp1

.run file=/tmp/tmp1

 BTEQ -- Enter your SQL request or BTEQ command:

select * from dbc.dbcinfo;

 *** Query completed. 3 rows found. 2 columns returned.

 *** Total elapsed time was 1 second.

InfoKey                        InfoData

------------------------------ --------------------------------------------

VERSION                        14.10.07.04

LANGUAGE SUPPORT MODE          Standard

RELEASE                        14.10.07.05

 BTEQ -- Enter your SQL request or BTEQ command:

 *** Warning: EOF on INPUT stream.

 BTEQ -- Enter your SQL request or BTEQ command:

.quit

2) Here is callig the same script from the command line in Linux passing in a username and password:

# bteq logon dbc,dbc < tmp1

BTEQ 14.10.00.11 Fri Jun 24 05:52:15 2016 PID: 20320

+---------+---------+---------+---------+---------+---------+---------+----

 logon dbc,

 *** Logon successfully completed.

 *** Teradata Database Release is 14.10.07.05                  

 *** Teradata Database Version is 14.10.07.04                    

 *** Transaction Semantics are BTET.

 *** Session Character Set Name is 'ASCII'.

 *** Total elapsed time was 1 second.

+---------+---------+---------+---------+---------+---------+---------+----

select * from dbc.dbcinfo;

 *** Query completed. 3 rows found. 2 columns returned.

 *** Total elapsed time was 1 second.

InfoKey                        InfoData

------------------------------ --------------------------------------------

VERSION                        14.10.07.04

LANGUAGE SUPPORT MODE          Standard

RELEASE                        14.10.07.05

+---------+---------+---------+---------+---------+---------+---------+----

 *** Warning: EOF on INPUT stream.

 *** BTEQ exiting due to EOF on stdin.

 *** Exiting BTEQ...

 *** RC (return code) = 0

 #

Below is the contents of the file mentioned above:

# cat /tmp/tmp1

select * from dbc.dbcinfo;