cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble connecting to dbisql with special characters

Former Member
2,877

I'm moving my production environment from Windows to Linux.
A shell script will be used to perform meta-data changes.

BUT
My DBA password has a single quote (') and an exclamation mark (!) in it.
And for the live of me, I can't get my shell script to connect.

Example. Say may password is
I,haven'tAnIdea!

I've tried escape characters:
dbisql -c "UID=DBA;PWD=I,haven\\'tAnIdea!;Server=pw02;ASTART=No"

I've tried placing my connection string in a file, with- , and without escape characters.
dbisql @connection.ini

I know the simplest would be to change my password. But that doesn't solve what has now become an obsession to solve!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

There seems to be 2 layers of parsing you need to escape for. Quadruple up those "'" chars

My test with granting a password of

grant connect to ... Identified by 'abc''def'

I found I needed to submit the password as

"...;PWD=abc''''def;..."

HTH

Former Member
0 Kudos

Thank you Nick. Will give it a try.

jack_schueler
Product and Topic Expert
Product and Topic Expert
0 Kudos

I wrote an "argv" app in C a very long time ago that displays the command line arguments that are passed on to "main" using a variety of methods (argc/argv, Windows GetCommandLine and GetCommandLineW, etc.). This handy tool lets you see how command-line arguments are massaged by your shell and the C run-time. Very, very useful in cases like this when you need to understand just what the application is actually seeing.