Personal tools
You are here: Home Forums DB2 Select
Navigation
Log in


Forgot your password?
 
Document Actions

Select

Up to DB2

Select

Posted by Ratheesh.K.Nair at May 06. 2009

Hi Exerts,


 


I am newbie to DB2 Please help me


Can anyone please tell me how to access an object from databaseA when we are connected to databaseB



Is it possible to query like this



SELECT * FROM DATABASE1.ADMINISTRATOR.CARDT

When I am connected to DATABASE2


 


TIA


Re: Select

Posted by perallis at May 07. 2009

Hello Nair,


 


See the solution in the link below:

How to use DB2 Federation


Re: Select

Posted by Ratheesh.K.Nair at May 07. 2009

Thanks Perallis,


 


Till fourth step its working fine after that  I am not able to do please help


 


My server is CY1160 Username:rknair Password:rknair123


DATABASE1=CARDAPPS


DATABASE2=CARDDEMO




TIA


Re: Select

Posted by Ratheesh.K.Nair at May 07. 2009

Also I am using 9.5C Express. Is it possible to federate database in this version?


Re: Select

Posted by perallis at May 07. 2009

Yes, It is possible to federate database on DB2 9.5 Express.


 


Please, put here your command and the output error.


 


Regards,
Perallis


Re: Select

Posted by Ratheesh.K.Nair at May 07. 2009

db2 => "create server CY1274 type DB2/UDB version '9.5c' wrapper drda authorizat
ion \"administrator\"scrolllock \"administrator\" options( add dbname 'carddemo
)"
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0007N  The character "\" following "tion \"administrator" is not valid.
SQLSTATE=42601


Re: Select

Posted by perallis at May 07. 2009


 


If your Username:rknair and Password:rknair123, try the command below, and type it out of CLP, so puu the word "db2" to execute it, as the line below.


 


db2 "create server sevdb2a type DB2/UDB version '9.5' wrapper drda authorization \"rknair\" PASSWORD \"rknair123\" options( add dbname 'db2a')

Re: Select

Posted by Ratheesh.K.Nair at May 08. 2009

HI Perillis,


 


I am using 9.5 C Express and the site given below shows that its not possible to federate database


http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.licensing.doc/doc/r0053238.html.


 


I tied the script you have given and getting error.


db2 => create server sevdb2a type DB2/UDB version '9.5' wrapper drda authorizat


on \"rknair\" PASSWORD \"rknair123\" options( add dbname 'db2a')


DB21034E  The command was processed as an SQL statement because it was not a


valid Command Line Processor command.  During SQL processing it returned:


SQL0007N  The character "\" following "r drda authorization" is not valid.


SQLSTATE=42601

 


Re: Select

Posted by perallis at May 08. 2009

Nair,


 


Yes, it is possible to federate databases on DB2 9.5 Express, you are getting syntax error.


 


Execute the command below on db2cmd, you are executing on CLP. Your error is a syntax error, if you got enable federated parameter, so it is possible federated on db2 express.


db2 "create server sevdb2a type DB2/UDB version '9.5' wrapper drda authorization \"rknair\" PASSWORD \"rknair123\" options( add dbname 'db2a')

or


db2 "create server sevdb2a type DB2/UDB version '9.5' wrapper drda authorization rknair PASSWORD rknair123 options( add dbname 'db2a')

 


Re: Select

Posted by Ratheesh.K.Nair at May 11. 2009

Hi Perallis,


Many thanks for you help.


 


I am still getting error


 


I am using Windows XP and  the script provided is for Linux..Is that the problem?


Re: Select

Posted by Ratheesh.K.Nair at May 11. 2009

db2 => create server sevdb2a type DB2/UDB version '9.5' wrapper drda authorizat
on rknair PASSWORD rknair123 options( add dbname 'db2a')
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL1101N  Remote database "db2a" on node "<unknown>" could not be accessed
with the specified authorization id and password.  SQLSTATE=08004


Re: Select

Posted by perallis at May 11. 2009

Hi Nair,


 


db2a is my database, your database is carddemo,


create server sevdb2a type DB2/UDB version '9.5' wrapper drda authorizaton rknair PASSWORD rknair123 options( add dbname ' carddemo')


In the next time try to read the message error, with it you will get to fix the syntax error.


Regards,
Perallis


Re: Select

Posted by Ratheesh.K.Nair at May 11. 2009

Hi Perallis,


 


I created databases db1a and db2a.


 


I am running this in command window.


 


Now I am getting Error 


db2 => create server sevdb2a type DB2/UDB version '9.5' wrapper drda authorizat
n rknair PASSWORD rknair123 options( add dbname ' db2a')
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "authorizaton" was found following "n '9.5'
wrapper drda".  Expected tokens may include:  "AUTHORIZATION".  SQLSTATE=42601


Re: Select

Posted by Ratheesh.K.Nair at May 11. 2009

Hi Perallis,


 


The above error got soloved when i gave authorization in CAPS.But I am still getting the same old error


db2 => create server sevdb2a type DB2/UDB version '9.5' wrapper drda AUTHORIZA
ON rknair PASSWORD rknair123 options( add dbname 'db2a')
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL1101N  Remote database "db2a" on node "<unknown>" could not be accessed
with the specified authorization id and password.  SQLSTATE=08004


 


Powered by Ploneboard
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls