How to exit a BTEQ in shell script?

Tools
Enthusiast

How to exit a BTEQ in shell script?

Hi All

I have a problem with BTEQ/shell, I have a series of unix cmd's and bteq logins; It seems after entering the BTEQ its not coming back to shell.

Ma script is like

unix cmd1

unix cmd2

bteq <<[Test]

.logmech ${TD_MECHANISMNAME}

.logon ${TD_DBCNAME}/${TD_USERNAME},${TD_PASSWORD}

some SQL Statements

.logoff

[Test]

unix cmd3

Here it never comes to cmd3, eventhough i logged off its trying to execute the unix cmd in Database and show you should logon before running, if i try quit or exit it comes out of the shell scritpt itself.

what am i missing??




Tags (2)
2 REPLIES
Enthusiast

Re: How to exit a BTEQ in shell script?

Hi Sachin,

Use  QUIT after LOGOFF, pls find the below difference-

LOGOFF

End the current session or sessions, but do not exit BTEQ

QUIT

End the current session or sessions and exit BTEQ.

Cheers!

Nishant

Enthusiast

Re: How to exit a BTEQ in shell script?

Hi Nishant,

  Thanks for u r reply, now i got the issue; I left an extra line before the [Test], That was causing the BTEQ not to exit/logoff properly. After removing the extra line its working as expected :)