rechie
rechie

Reputation: 2217

Python - Connect AS400 Collection using ibm_db

I am able to connect to our database given the following connection string (OLEDB).

"Provider=IBMDA400;Data Source=10.33.xx.x;User Id=user;Password=pass;Default Collection=mm370lib;";

Then tried (Python ibm_db)

import ibm_db, ibm_db_dbi
ibm_db_conn = ibm_db.connect("DRIVER={IBM DB2 CLI DRIVER};DATABASE=mm370lib;HOSTNAME=10.33.xx.x;PORT=446;PROTOCOL=TCPIP;UID=user;PWD=pass;", '', '')

But this error occured.

Exception: [IBM][CLI Driver] SQL30061N  The database alias or database name "MM370LIB          " was not found at the remote node.  SQLSTATE=08004 SQLCODE=-30061

What did I missed? Are the database Name and Default Collection different?

Upvotes: 0

Views: 3410

Answers (1)

Charles
Charles

Reputation: 23823

Yes, the DB name is usually the system name; though it doesn't have to be.

Originally, the AS/400 support only a single DB.

With the introduction of independent storage pools (iASP), today's IBM i machines can have multiple DBs.

From a 5250 session, try:

WRKRDBDIRE

Look for the *LOCAL entry, may be the only one.

You can also see the DB names using IBM i Navigator for Windows or the web based IBM Navigator. The DB names are shown under the "Databases" iNav for Windows screen shot,
there are three DBs on the system: Rchasma1, Iasp320, Ima1db1.

Upvotes: 2

Related Questions