Showing results for 
Search instead for 
Do you mean 

SQL to return a recordset of Trim Containers

Highlighted
Occasional 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
Honored Contributor

Re: SQL to return a recordset of Trim Containers

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

Occasional 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.

Occasional 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
Honored 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.

Regular Advisor

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.

 

 

 


**My opinions are my own personal opinions.


kapish.com.au