Fetch the data of selected Rows in a table.

I want to get the data of selected rows in a table .How could this be achieved?.

Agile Talent Asked on February 29, 2016 in Agile PLM (v9),   Product Collaboration.
Add Comment
2 Answer(s)

Using API you can use following example to retrieve a table content (ex. Item relationships)

ITable relationship = agileObject.getTable(ItemConstants.TABLE_RELATIONSHIPS);
Iterator<IRow> rel= relationship.iterator();
 while (rel.hasNext()) {
IRow singleRow = rel.next();
String description = singleRow.getValue(ItemConstants.ATT_RELATIONSHIPS_DESCRIPTION);
IDataObject referent = singleRow.getReferent();
// dowhat you want with the referent object
Agile Angel Answered on February 29, 2016.
Add Comment

There are 2 ways  to interpret your question : Get data for a specific object and/or tab in the application, or get data for specific records in a specific table.
 For the first, your question is rather broad, as every business object has different attributes, and therefore the means of getting the data would vary depending on the table (or tables) you wish to access. But it would require knowing how to handle the various data types (how are multi-list attributes processed??).
 For the second, just about every table in the database has a unique value in it’s ID attribute (a few do not have an ID attribute, but that’s an entirely different question). Figuring out what that ID value is requires knowing the table key value(s). For instance, the item number or the combination of assembly number/component number/assembly revision (and therefore change) for a BOM record. Since you have to know the key value(s), you can already identify the records you wish to access.

 Using the API as Antonio suggests is the best means of accessing data from the database. Trying to use SQL*Plus (or PL*SQL) will require that you figure out how to process list, multilist, multitext, money and weight values (since none of them are simple and straightforward, although list can be pretty simple, depending on the attribute). The same thing applies when using the API, you can select distinct rows knowing the key values, and so get what you want.

Agile Angel Answered on February 29, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.