SQL to return a recordset of Trim Containers (566 Views)
Reply
Occasional Contributor
qgatwork
Posts: 4
Registered: ‎11-21-2011
Message 1 of 6 (566 Views)

SQL to return a recordset of Trim Containers

Not being very familiar with Trim I'd really appreciate a little help.

I need to run an SQL command to return a recordset of all the Trim Containers within a database. Can anyone help me with the sql? I can see that the tcrecords table appears to hold all the records but I can't seem to find a column that reliably allows me to filter exactly what I am after.

Any help would be very much appreciated.

Thanks!

Honored Contributor
EWillsey
Posts: 1,877
Registered: ‎04-20-2010
Message 2 of 6 (557 Views)

Re: SQL to return a recordset of Trim Containers

select recordId from tsrecord where uri in (select rcContainerUri from tsrecord)

Occasional Contributor
qgatwork
Posts: 4
Registered: ‎11-21-2011
Message 3 of 6 (552 Views)

Re: SQL to return a recordset of Trim Containers

That will only give me root level containers won't it? I need all records of type container regardless of level.

Occasional Contributor
qgatwork
Posts: 4
Registered: ‎11-21-2011
Message 4 of 6 (551 Views)

Re: SQL to return a recordset of Trim Containers

What about this?

SELECT TITLE
FROM TSRECORD LEFT OUTER JOIN
TSRECTYPE ON TSRECORD.rcRecTypeUri = TSRECTYPE.uri
WHERE TSRECTYPE.baseType = 2
Honored Contributor
EWillsey
Posts: 1,877
Registered: ‎04-20-2010
Message 5 of 6 (526 Views)

Re: SQL to return a recordset of Trim Containers

You're right then.  My statement just returned things that actually had contents, not things defined to be folders.

Regular Advisor
Ralf_Wegener
Posts: 131
Registered: ‎08-21-2010
Message 6 of 6 (477 Views)

Re: SQL to return a recordset of Trim Containers

[ Edited ]

I'm assuming you've declared the relevant TRIM API structure already. I usually find it quite helpful if activity log pane is turned on and let TRIM generates the SQL statements (not 100% but it points you in the right direction) using standard TRIM search methods. When you perform a search and an equivalent SQL statement is produced.

 

Turni Activity Log  Pane On:

 

- Select - View Drop Down Menu

- Select Activity Log Pane (or make sure it's ticked)

- Select Dataset Tab

- Right click - select Start Logging

- Now perform any standard TRIM functions

- The equivalent SQL statement is produced - just copy and paste and incorporate to your recordset query.

- Takes a bit of fine tuning but it helps.

 

 

Note:

Allow HP TRIM SDK applications to directly query the HP TRIM dataset - select to allow any applications that use the HP TRIM SDK to connect to HP TRIM - is turned on and your account has the relevant permission.

 

 

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.