Follow

Sample regular expressions for export from termbase

Before you execute this command, you will have to verify what AttrTypeID "subject" has in your termbase. You can do that by opening the AttrTypes table within the termbase with Microsoft Access. Look for the ID that represents subject. In this example we assume that this code is 5, but this will not necessarily be the case for your database.
Because the date field also contains a time value, you have to add lower and upper boundaries.

Following are some SQL Statements you can use to filter segments in a Termbase, or in the Termbase export wizard.

Name SQL (Structured Query Language)
Export records of subject "123" from termbase.note
ID IN (SELECT LemmaID FROM Attributes WHERE AttrTypeID = 5 and TextValue = '123')
Export records of client "987" from termbase.note
ID IN (SELECT LemmaID FROM Attributes WHERE AttrTypeID = 6 and TextValue = '987')
Export records of client "987" and subject "123" from termbase.note
ID IN (SELECT LemmaID FROM Attributes WHERE AttrTypeID = 6 and TextValue = '987') AND ID IN (SELECT LemmaID FROM Attributes WHERE AttrTypeID = 5 and TextValue = '123')
Export termbase records entered on or after December 21, 2014.
ID IN (SELECT OrgLemmaID FROM Relations WHERE Datestamp >= #12/21/2014#) OR ID IN (SELECT DstLemmaID FROM Relations WHERE Datestamp >= #12/21/2014#)
Export termbase records entered on December 21, 2014.note
ID IN (SELECT OrgLemmaID FROM Relations WHERE Datestamp >= #12/21/2014# AND Datestamp<#12/22/2014#) OR ID IN (SELECT DstLemmaID FROM Relations WHERE Datestamp >= #12/21/2014# AND Datestamp<#12/22/2014#)
Export termbase records entered between January 1, 2015, and January 31, 2015.
ID IN (SELECT OrgLemmaID FROM Relations WHERE Datestamp >= #1/1/2015# AND Datestamp<#2/1/2015#) OR ID IN (SELECT DstLemmaID FROM Relations WHERE Datestamp >= #1/1/2015# AND Datestamp<#2/1/2015#)
Export termbase records entered on December 21, 2014, between 12 pm and 3 pm.
ID IN (SELECT OrgLemmaID FROM Relations WHERE Datestamp >= #12/21/2014 11:00# AND Datestamp<#12/21/2014 15:00#) OR ID IN (SELECT DstLemmaID FROM Relations WHERE Datestamp >= #12/21/2014 11:00# AND Datestamp<#12/21/2014 15:00#)
Export all termbase records in U.S. English starting with "ABC".
Lang=9 AND SubLang = 1 Lemma LIKE 'ABC*'
Export all termbase records in U.S. English containing "ABC".
Lang=9 AND SubLang = 1 Lemma LIKE '*ABC*'
Export all termbase records from User "Joe".
ID IN (SELECT OrgLemmaID FROM Relations WHERE UserNick = 'Joe') OR ID IN (SELECT DstLemmaID FROM Relations WHERE UserNick = 'Joe')
Export all lemmas that appear more than once in the Termbase.
ID IN (SELECT a.ID
FROM Lemmas a
INNER JOIN (SELECT Lemma, COUNT(*)
FROM Lemmas
GROUP BY Lemma
HAVING count(*) > 1 ) b
ON a.Lemma = b.Lemma)
Export all lemmas that have more than one translation.
ID IN (SELECT a.ID
FROM Lemmas a
INNER JOIN (SELECT OrgLemmaID, COUNT(*)
FROM Relations
WHERE RelTypeID IN (SELECT ID FROM RelTypes WHERE Token = "translation")
GROUP BY OrgLemmaID
HAVING COUNT(*) > 1) b
ON a.ID = b.OrgLemmaID)
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk