Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / December 2006

Tip: Looking for answers? Try searching our database.

Federated Database Problem.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Asphalt Blazer - 13 Dec 2006 19:29 GMT
I am running this command.

db2 "CREATE SERVER <servername> TYPE DB2/UDB VERSION 8.2 WRAPPER DRDA
AUTHORIZATION "authid" PASSWORD "pwd" OPTIONS( DBNAME 'dbname',
PASSWORD 'Y')"
DB21034E  The command was processed as an SQL statement because it was
not a
valid Command Line Processor command.  During SQL processing it
returned:
SQL1822N  Unexpected error code "-30082" received from data source
"DBNAME".
Associated text and tokens are " SQL30082N  Attempt to establish
connection

I go into db2 prompt and I do this

db2 => CREATE SERVER <servername> TYPE DB2/UDB VERSION 8.2 WRAPPER DRDA
AUTHORIZATION "authid" PASSWORD "pwd" OPTIONS( DBNAME 'dbname',
PASSWORD 'Y')

This works. Can anybody tell me why the former fails while the one
latter works? Is it the problem with quotes around the auth id and
pwd????

Any help appreciated.
Shashi Mannepalli - 13 Dec 2006 21:02 GMT
Put the first statement in a file and run like this

db2 -tvf <file>

CREATE SERVER <servername> TYPE DB2/UDB VERSION 8.2 WRAPPER DRDA
> AUTHORIZATION "authid" PASSWORD "pwd" OPTIONS( DBNAME 'dbname',
> PASSWORD 'Y'

cheers..
Shashi Mannepalli

> I am running this command.
>
[quoted text clipped - 21 lines]
>
> Any help appreciated.
amalnair@gmail.com - 13 Dec 2006 21:09 GMT
This essentially means I will have to hardcode the password in the sql
file right? I would not want to do that.
> Put the first statement in a file and run like this
>
[quoted text clipped - 32 lines]
> >
> > Any help appreciated.
Knut Stolze - 14 Dec 2006 08:44 GMT
> I am running this command.
>
> db2 "CREATE SERVER <servername> TYPE DB2/UDB VERSION 8.2 WRAPPER DRDA
> AUTHORIZATION "authid" PASSWORD "pwd" OPTIONS( DBNAME 'dbname',
> PASSWORD 'Y')"

Have a look at this from a shell perspective.  You have:

db2 "..."authid"..."pwd"..."

Note that double-quotes begin/end strings.  Now notice what the nested
double-quotes are doing.  They terminate a string and are not passed to
DB2.  Therefore, DB2 will get the following SQL statement:

CREATE SERVER <servername> TYPE DB2/UDB VERSION 8.2 WRAPPER DRDA
  AUTHORIZATION authid PASSWORD pwd
  OPTIONS( DBNAME 'dbname', PASSWORD 'Y')

authid and pwd are unquoted, which means they will be upper-cased.  (Things
are even worse if your pwd contains special characters.)  To remedy the
situation, you have to make sure that your double-quote characters are not
handled by your shell and passed to DB2 instead by escaping them:

db2 "CREATE SERVER <servername> TYPE DB2/UDB VERSION 8.2 WRAPPER DRDA
  AUTHORIZATION \"authid\" PASSWORD \"pwd\"
  OPTIONS( DBNAME 'dbname', PASSWORD 'Y')"

Signature

Knut Stolze
DB2 z/OS Utilities Development
IBM Germany

Asphalt Blazer - 14 Dec 2006 14:46 GMT
Thanks, I understood what was happening. What I was looking for was the
remedy. Thanks a lot. I appreciate it.

> > I am running this command.
> >
[quoted text clipped - 22 lines]
>    AUTHORIZATION \"authid\" PASSWORD \"pwd\"
>    OPTIONS( DBNAME 'dbname', PASSWORD 'Y')"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.