Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.


Our DB2 authentication is integrated with active directory, so the allowed passwords are controlled by it's policy. We have some users that are not being able to connect to the database through Command Editor or the Query screen in Control Center. The error is the following:

SQL0104N  An unexpected token "!" was found following "".  
Expected tokens may include:  "NEW".
 SQLSTATE: 42601
 sqlcode: -104

They are able to connect through Command Line Processor as far as they don't include the password in the connect statement.
The problem is affecting all users with some special characters in their passwords. We had them try issuing the connect statement without the password in Command Editor but it didn't work.
The exact version of the database is DB2/AIX64 9.5.4
Is there a way for them to use this tools other that to have them change their passwords?
Thanks

share|improve this question
    
It may also be worth noting that IBM is deprecating the GUI tools (Control Center and others) packaged with DB2. They are now recommending you use either command line, or download IBM Data Studio which can be downloaded for free, if you wish to use GUI tools. –  Chris Aldrich May 30 '12 at 13:04

3 Answers 3

up vote 4 down vote accepted

This is a long-standing bug in the GUI tools.

However, as long as your password does not contain a double quote (") character, then you can work around this by putting double quotes around the password to connect.

connect to sample user test using test!
--> SQL0104N

connect to sample user test using "test!"
--> connection succeeded.

This method will also work if the GUI tools prompt you for a password with a dialog box.

If you have passwords with double quotes in them, you may be out of luck. You could open a ticket with IBM DB2 support and/or just change the password.

share|improve this answer
    
Thanks! that worked. If anyone comes with a password with " in it we will have him change it, but I don't expect it to be too often. –  Guillermo Vasconcelos Jun 2 '11 at 12:55

Enclose your password with special characters within Singlequote, Doublequote pair. Ex: Passwd='"test!"'

This will work for sure.

share|improve this answer

Write a script with #!/bin/ksh as the first line. Escape the password with combination of single quotes, double quote pair, first line declaration is important.

#!/bin/ksh

db2 connect to &db2name& user &username& using "'&password&'"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.