All Forums Viewpoint
ldkhang 12 posts Joined 10/10
18 Nov 2010
Retrieve database/Table name

Hi all,

Can PDK provide the resolution of database/table name given its ID? I haven't figured out the right method to call yet.

The context of this question is when I want to output the database/table name that is causing a block on a particular session. The SessionDAO gives us the id details, but not the names.

Warmest regards,

stever 149 posts Joined 08/09
18 Nov 2010

The database and table names currently have to come from the Teradata system. Use the following method on com.teradata.monitor.dao.jdbc.TeradataMonitorDAOJDBC:

* Identifies (the name of) a session, user, database, or table, given it's id
* @param hostId
* the host id.
* @param sessionNumber
* the session number.
* @param databaseId
* the database id,.
* @param userId
* the user id.
* @param tableId
* the table id.
* @return the name of the entity.
String identify(int hostId, int sessionNumber, int databaseId, int userId, int tableId);

To get the database name, call identify(-1, -1, databaseId, -1, -1). To get the table name, call identify(-1, -1, -1, -1, tableId).

ldkhang 12 posts Joined 10/10
20 Nov 2010

Thanks a lot, Stever :)

You must sign in to leave a comment.