Teradata Wallet

Tools
Enthusiast

Teradata Wallet

Hello!

I'm trying to use teradata wallet for encrypt user password on some script.

I have insert an item named PWD_SSF_DEV and then I've crete the script deptquery.txt.

This is the source code:

.logon 11.51.71.141/US_FND_SSF_DEV,$tdwallet(PWD_SSF_DEV)

.logoff

.exit

If I run BTEQ < deptquery.txt , work correctly, but I would like to use the wallet also in a script bash like this:

#!/bin/bash

[...]

bteq  <<EOF

.logon 11.51.71.141/US_FND_SSF_DEV,"$tdwallet(PWD_SSF_DEV)";

[...]

.quit

EOF

( where US_FND_SSF_DEV is the user whose password is defined in the wallet item )

unfortunately , this script returns this error:


.logon 11.51.71.141/US_FND_SSF_DEV,

*** Error: Logon failed!

*** Total elapsed time was 1 second.

Thank you for helping!

6 REPLIES
Teradata Employee

Re: Teradata Wallet

I suspect you are using the quotes incorrectly. You should quote "EOF"

bteq << "EOF"

not the $tdwallet keyword.

Enthusiast

Re: Teradata Wallet

I change my script in 

#!/bin/bash

[...]

bteq  <<EOF

.logon 11.51.71.141/US_FND_SSF_DEV,$tdwallet(PWD_SSF_DEV);

[...]

.quit

EOF

... with the same result  :-(

Why should I use the quote "EOF" ?

Enthusiast

Re: Teradata Wallet

The solution is to use the escape char (\) before the command $tdwallet, so this is my script

#!/bin/bash

[...]

bteq  <<EOF

.logon 11.51.71.141/US_FND_SSF_DEV,\$tdwallet(PWD_SSF_DEV)

[...]

.quit

EOF

Teradata Employee

Re: Teradata Wallet

Quoting "EOF" and escaping the dollar-sign do the same thing -- prevent the shell from interpreting the $tdwallet keyword as a shell script variable.

Enthusiast

Re: Teradata Wallet

Can we point Tara script to the Teradata Wallet for passowrds?  This would make password changes so much easier.

Thanks.

Teradata Employee

Re: Teradata Wallet

I don't know anything about Tara, how it works, or what it uses for logging on to the Teradata Database.