Access Xmeta

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
altruist
Participant
Posts: 73
Joined: Thu May 11, 2006 6:50 am

Access Xmeta

Post by altruist »

Hi,

I want to query a xmeta table to get user info. Can you please let me know how to access xmeta.

I was able to do the same in Unix Server through Shell Script. But not sure how to access from Windows Server.

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What shell script? It should also work on Windows.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
altruist
Participant
Posts: 73
Joined: Thu May 11, 2006 6:50 am

Post by altruist »

Code: Select all

#!/bin/ksh

db2 << EOF > /home/db2inst1/log

connect to xmeta

select distinct tabschema || ','|| tabname from syscat.tables

EOF
This is part of test code [test.sh]. Where can I place this code in Windows Server and how can I call it ?
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Try creating a Windows batch file that calls the DB2 command line utility. The DB2 commands syntax (your SQL) should be able to remain as is.
Choose a job you love, and you will never have to work a day in your life. - Confucius
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You've got MKS Toolkit (UNIX emulator) on Windows. So you can run Korn shell scripts.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

With the toolkit route, check your 3 paths in the script you've shown.

Is /bin/ksh correct?

Is "db2" correct? It should work if "db2" is in your PATH.

Is /home/db2inst1/log correct on Windows?
Choose a job you love, and you will never have to work a day in your life. - Confucius
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So long as /home is defined on the currently logged drive (the same drive on which Information Server is installed) and db2inst1 is defined in there, then you should be OK.

For example, if IIS is installed on E: drive, then E:\tmp is treated as /tmp.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply