unable to run the Simple BTEQ script

General
Enthusiast

unable to run the Simple BTEQ script

Hi All,

i have tried to run a simple command in BTEQWIN

.SET SESSION TRANSACTION ANSI

.SET FORMAT ON

.SET INDICDATA OFF

.LOGON 127.0.0.1/DBC,DBC

database customer_service;

.SET FORMAT OFF

.EXPORT DATA FILE = EXPORT_DATA_EMP.txt

.SET WIDTH 200

SELECT * FROM employee;

.EXPORT RESET

.LOGOFF


Error Message

.SET SESSION TRANSACTION ANSI.SET SESSION TRANSACTION ANSI

.SET FORMAT ON

.SET INDICDATA OFF

.LOGON 127.0.0.1/DBC,DBC

database customer_service;

.SET FORMAT OFF

.EXPORT DATA FILE = EXPORT_DATA_EMP.txt

.SET WIDTH 200

SELECT * FROM employee;

.EXPORT RESET

.LOGOFF Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

.SET FORMAT ON

 Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

.SET INDICDATA OFF

 Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

.LOGON 127.0.0.1/DBC,DBC

 *** Error:  Invalid logon!

 Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

database customer_service;

 *** Warning: You must log on before sending SQL requests. 

 Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

.SET FORMAT OFF

 Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

.EXPORT DATA FILE = EXPORT_DATA_EMP.txt

 *** To reset export, type .EXPORT RESET

 Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

.SET WIDTH 200

 Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

SELECT * FROM employee;

 *** Warning: You must log on before sending SQL requests. 

 Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

.EXPORT RESET

 *** Output returned to console.

 Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

Issue what i have noticed is  *** Error:  Invalid logon!

Quick Checks

i have checked the ODBC driver conections as well they  are fine what could be the issue?

5 REPLIES
Enthusiast

Re: unable to run the Simple BTEQ script

Rakesh,

You've got a sql statment on the end of you logon.

database customer_service;

This should immediately preceed your select statement.

Rglass

Enthusiast

Re: unable to run the Simple BTEQ script

Glass,

It's still showing the same error.

Enthusiast

Re: unable to run the Simple BTEQ script

You may also want to logon before setting any sql flags but I don't know why your error is still invalid logon.

Enthusiast

Re: unable to run the Simple BTEQ script

is DBC the password for DBC user or is it a different one.

Enthusiast

Re: unable to run the Simple BTEQ script

Thanks Glass,Krish....i figured it out the issue it's the logon issue and the script issue as well


 Teradata BTEQ 15.00.00.00 for WIN32. PID: 7092

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

 Enter your logon or BTEQ command:

.logon 127.0.0.1/dbc

.logon 127.0.0.1/dbc

Password:

 *** Logon successfully completed.

 *** Teradata Database Release is 13.00.00.12

 *** Teradata Database Version is 13.00.00.12

 *** Transaction Semantics are BTET.

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

 *** Total elapsed time was 1 second.

 BTEQ -- Enter your SQL request or BTEQ command:

.OS del EXPORT_DATA_EMP.txt

.OS del EXPORT_DATA_EMP.txt

 BTEQ -- Enter your SQL request or BTEQ command:

.SET SESSION TRANSACTION ANSI

.SET SESSION TRANSACTION ANSI

 *** Error: You must not be logged on to change the SQLFLAG or

            TRANSACTION settings.

 BTEQ -- Enter your SQL request or BTEQ command:

.SET FORMAT ON

.SET FORMAT ON

 BTEQ -- Enter your SQL request or BTEQ command:

.SET INDICDATA OFF

.SET INDICDATA OFF

 BTEQ -- Enter your SQL request or BTEQ command:

.LOGON 127.0.0.1/dbc,dbc

.LOGON 127.0.0.1/dbc,dbc

 *** Error:  Invalid logon!

 BTEQ -- Enter your SQL request or BTEQ command:

 DATABASE CUSTOMER_SERVICE;

DATABASE CUSTOMER_SERVICE;

 *** New default database accepted.

 *** Total elapsed time was 1 second.

 BTEQ -- Enter your SQL request or BTEQ command:

.SET FORMAT OFF

.SET FORMAT OFF

 BTEQ -- Enter your SQL request or BTEQ command:

.EXPORT DATA FILE = EXPORT_DATA_EMP.txt

.EXPORT DATA FILE = EXPORT_DATA_EMP.txt

 *** To reset export, type .EXPORT RESET

 BTEQ -- Enter your SQL request or BTEQ command:

.SET SEPARATOR '|'

.SET SEPARATOR '|'

 BTEQ -- Enter your SQL request or BTEQ command:

 SELECT * FROM EMPLOYEE;

SELECT * FROM EMPLOYEE;

 *** Success, Stmt# 1 ActivityCount = 10

 *** Query completed. 10 rows found. 9 columns returned.

 *** Total elapsed time was 1 second.

 BTEQ -- Enter your SQL request or BTEQ command:

.EXPORT RESET

.EXPORT RESET

 *** Output returned to console.

 BTEQ -- Enter your SQL request or BTEQ command:

.LOGOFF

.LOGOFF

 *** You are now logged off from the DBC.

 Teradata BTEQ 15.00.00.00 for WIN32. Enter your logon or BTEQ command:

.QUIT

.QUIT

 *** Exiting BTEQ...

 *** RC (return code) = 0

Observations - My output(Data File) is corrupted with all the special characters what could be the issue??