password interpretation in tpt script using tdwallet

Tools & Utilities

password interpretation in tpt script using tdwallet

Hi, 

 

I am facing problem  while intrepreatation of password using tdwallet.

I've a requirement to write a generic AIX shell script which is used to execute tpt scripts. 

I am using tbuild -f command within script and supplying other parameters using -u options.

As script used $tdwallet(@TD_USERNAME) as password value and value of TD_USERNAME is being supplied from shell script.

        VARCHAR USERPASSWORD = '$tdwallet(@TD_USERNAME)', 

However I am getting following error.

 

EXPORT_OPERATOR: TPT10507: CLI Error 543: CLI2: TDWALLETERROR(543): Teradata Wallet error. The wallet does not contain an item named "@TD_USERNAME"

 

Pls suggest how can I correct it.

 

-- Samir


Accepted Solutions
Teradata Employee

Re: password interpretation in tpt script using tdwallet

The TPT parser will not parse anything in single quotes in a TPT script.

Those strings get passed along as-is.

 

Thus, to use a job variable within single quotes, you have to break up the string to a series of substrings and concatenate them together, like this:

 

VARCHAR USERPASSWORD = '$tdwallet(' || @td_USERNAME || ')', 

-- SteveF
1 ACCEPTED SOLUTION
2 REPLIES
Teradata Employee

Re: password interpretation in tpt script using tdwallet

The TPT parser will not parse anything in single quotes in a TPT script.

Those strings get passed along as-is.

 

Thus, to use a job variable within single quotes, you have to break up the string to a series of substrings and concatenate them together, like this:

 

VARCHAR USERPASSWORD = '$tdwallet(' || @td_USERNAME || ')', 

-- SteveF

Re: password interpretation in tpt script using tdwallet

Thanks @feinholz . 

It is working now.

 

- Samir