cancel

SQL to return a recordset of Trim Containers

Highlighted
qgatwork
Contributor.

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!

5 REPLIES
EWillsey
Acclaimed Contributor.

Re: SQL to return a recordset of Trim Containers

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

---------
Erik
CMRamble.com
qgatwork
Contributor.

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.

qgatwork
Contributor.

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
EWillsey
Acclaimed Contributor.

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.

---------
Erik
CMRamble.com
Ralf_Wegener
Honored Contributor.

Re: SQL to return a recordset of Trim Containers

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.

 

 

 


**My opinions are my own personal opinions.


kapish.com.au