tdwallet not working


tdwallet not working

Using tdwallet version

I can not get $tdwallet to work in any way.  The tdwallet utility works and lets me add entries and delete entries.  But, in a bteq, the value is not substituted and I get a logon error.  For ease, I created an entry u with a value of the username and p with the password. 

Use tdwallet list to show the entries are there...

 >tdwallet list



I tried bteq in a script with the logon like this.

.logon mydatabase/$tdwallet(u),$tdwallet(p) ;

This generates

 *** Failure 8017 The UserId, Password or Account is invalid.

 *** Error: Logon failed!

If I try

.logon mydatabase/myuser,$tdwallet(p);      I get the same result.

If I try it interactively to test if tdwallet will supply the user and l supply the password after prompting; same result.

If in the script, I create a variable  LOGONCMD=".logon mydatabase/$tdwallet(u),$tdwallet(p) " and supply $LOGONCMD in the bteq inside the script...  same result. 

If I change $tdwallet(u) and $tdwallet(p) to the appropriate values, the bteq works as expected.

When I see the output trying to use $tdwallet, it always looks like it is evaluating a $tdwallet variable and finding this like an undefined script variable just leaving the (u) like it would outside of bteq.  I have changed the real database name to "mydatabase" in this example.

BTEQ Tue May 17 20:42:47 2016 PID: 27672


.logmech TD2;


.LOGON mydatabase/(u),                            ( NOTE: I typed  $tdwallet(u)  here.  What is shown is the output)


 *** Failure 8017 The UserId, Password or Account is invalid.

 *** Error: Logon failed!

I know the user / password combination is correct.  I can substitute these and the logon works normally.  I have tried deleting the u and p entries from tdwallet and recreating them just to be certain the values are correct.  No change in the results.

I tried to turn on the debug information.  It isn't helpful...

CALL wallet constructor(locale="en") (tid=0xD0B6CFF7)

wallet constructor RETURNS (wallet=0x894D7C8,tid=0xD0B6CFF7)

CALL getVersion() (wallet=0x894D7C8,tid=0xD0B6CFF7)

getVersion RETURNS "" (wallet=0x894D7C8,tid=0xD0B6CFF7)

CALL wallet destructor() (wallet=0x894D7C8,tid=0xD0B6CFF7)

wallet destructor RETURNS (tid=0xD0B6CFF7)

Can someone please help me figure out what is happening / missing.  Other posts about tdwallet imply it's easy to get set up and use.  Maybe I'm missing something simple here.  Maybe a config issue.


Re: tdwallet not working

Well I found the problem.  The "$" on $tdwallet has to be escaped in a shell script. 

Valid method is

.logon mydatabase/\$tdwallet(uservalue),\$tdwallet(pwvalue) 

That worked.