Focal Point
Connecting to DB2

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1971028331

January 24, 2005, 01:37 PM
Håkan
Connecting to DB2
We're having problems connecting to DB2 in order to use SQL pass-thru. The following statement gives an error.

ENGINE DB2 SET CONNECTION_ATTRIBUTES AXXXXXXXX/,

(FOC1400) SQLCODE IS -104 (HEX: FFFFFF98) XOPEN: 42000

WebFOCUS 5.2.7 on IBM iSeries 5.2.

Tia,
Hakan
January 24, 2005, 01:52 PM
TexasStingray
Do you have any problems access DB2 via a table request? Do you issue a SQL SQLDB2 comand before you SQL statement. Can you issue the same SQL ib a tool like QMF? What Version of DB2?
January 25, 2005, 07:19 AM
Håkan
Texas,

the following TABLE request works fine:

SQL DB2 CONNECT;
TABLE FILE DS_DAY_VW
PRINT *
END

Hakan
January 25, 2005, 12:21 PM
TexasStingray
For each Synonym (MASTER FILE DESCRIPTION) there are 2 file one with a .mas and one with a .acx the acx is the key here. It tell WebFOCUS what the true DB2 table name is. If you can look at is it should look something like this:

SEGNAME=DSDAYVW,
TABLENAME='???.DS_DAY_VW',
CONNECTION=<SOMEDB2INSTANCE>,
KEYS=?
,$

once you have this you should be able to do something like this.

SQL SQLDB2 CONNECT;
SQL SQLDB2
SELECT * FROM ???.DS_DAY_VW;
TABLE FILE SQLOUT
PRINT *
WHERE READLIMIT EQ 10
END

Give this a try.
January 25, 2005, 12:51 PM
Håkan
Texas,

thanx. The site I'm currently working at did not allow the period in the object name. They are using the default iSeries / convention, eg. dbname/tablename instead of the standard SQL dbname.tablename.

/Hakan