0

I am unable to log on bteq on linux using script, what am I doing wrong?

echo ".LOGMECH LDAP\n.LOGON eiwd/${USER_ID},${PASSWORD};\n.LOGOFF;\n.EXIT" > $UAT_COUNT/test_spool_bteq.sql

bteq < $UAT_COUNT/test_spool_bteq.sql > $UAT_COUNT/test_spool_log.log

OUTPUT

Error: Invalid command syntax.
Extra text found starting at '\n.LOGON eiwd/u431311,mum'.
* Warning: You must log on before sending SQL requests.
*
Warning: EOF on INPUT stream.

Sandeep
  • 1,504
  • 7
  • 22
  • 32
altaf
  • 23
  • 4
  • You may need a semi-colon after the .LOGMECH command and the \n doesn't seem to be translating in the echo redirection. – Rob Paller Feb 19 '16 at 16:27
  • you can try `echo -e` http://stackoverflow.com/questions/9139401/trying-to-embed-newline-in-a-variable-in-bash and what is in your created sql file? – KeepCalmAndCarryOn Feb 21 '16 at 12:00

0 Answers0