BTEQ - interactive vs. batch mode - ssh access to windows workstation

Tools & Utilities
Fan

BTEQ - interactive vs. batch mode - ssh access to windows workstation

Hello everyone,

I experience a little bit strange bteq behaviour in my a little bit strange environment. Maybe someone will have some tips.

On a Win XP workstation I've got TTU 12.0. BTEQ works fine locally.

Then I installed Cygwin and started cygwin sshd (ssh daemon) in order to be able to work remotely on this PC.

When I locally start cygwin shell window (bash), bteq works well too. But when I access the shell remotely via ssh, when I start bteq with no command line parameters, no redirections, just bare bteq command, it starts in batch mode instead of interactive mode: it only accepts .LOGON in form .logon tdpid/user,passwd, doesn't display standard interactive bteq banner, complains after pressing backspace (*** Warning: Invalid character, decimal value =127).

I suppose bteq recognizes internally whether it is run interactively or in batch mode by inspecting in some way where the standard input comes from and it gets confused by some redirections used by ssh layer.

Has anyone had the same problem? Is there any solution? Any ideas? Is it a bug or just an unsupported way of operating bteq?

Thank you
Jacek Adamowicz
4 REPLIES
Teradata Employee

Re: BTEQ - interactive vs. batch mode - ssh access to windows workstation

Don't forget that cygwin is a linux emulator. The bteq for windows is compiled to run interactivley if no logon is provided. I find that providing the login in a file and use the .run file command works best when doing the cygwin/bteq dance.
Fan

Re: BTEQ - interactive vs. batch mode - ssh access to windows workstation

Well, I am able to run scripts, but working interactively is also a useful thing sometimes, isnt't it?

Jacek
Teradata Employee

Re: BTEQ - interactive vs. batch mode - ssh access to windows workstation

Yes - but you can't open a Windows window from cygwin. So, the interactive logon never appears.
Fan

Re: BTEQ - interactive vs. batch mode - ssh access to windows workstation

I'm not talking about bteqwin but normal command line bteq (for windows). It doesn't show a windows dialog box, it enters conversation mode in command line. If you run cmd.exe in windows and type bteq you'll see something like below. After "Password:" bteq stops and waits for password. The problem is that bteq if run via cygwin ssh "thinks" that it is run in batch mode while I want it to be interactive.

[font=Courier New]Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>bteq

Teradata BTEQ 12.00.00.00 for WIN32.
Copyright 1984-2007, NCR Corporation. ALL RIGHTS RESERVED.
Enter your logon or BTEQ command:
.logon tdjad/jaceka

.logon tdjad/jaceka
Password:

*** Logon successfully completed.
*** Teradata Database Release is 12.00.00.10
*** Teradata Database Version is 12.00.00.10
*** Transaction Semantics are BTET.
*** Character Set Name is 'ASCII'.

*** Total elapsed time was 1 second.

BTEQ -- Enter your DBC/SQL request or BTEQ command:[/font]