FROM Predicate

Topic Last Modified: 2006-06-13

The Structured Query Language (SQL) FROM Predicate is used in the SQL SELECT Statement to indicate where the search takes place.

FROM "URL"

In the above syntax "URL" is the URL of a folder in an Exchange store where the shallow traversal search is to take place.

Example

This is an example of a simple SQL query string. In the third line, strURL is a string containing the URL of the folder to be searched. In the fourth line, sender is a string containing the name of a sender.

'construct the SQL query
strQ = "SELECT ""urn:httpmail:subject"" "
strQ = strQ & "FROM """ & strURL & """ "
strQ = strQ & "WHERE ""urn:schemas:httpmail:sendername"" = '" & sender & "'"

Remarks

The optional SQL SCOPE Element can also be used in the FROM Predicate:

FROM SCOPE('[shallow|deep|hierarchical] traversal of "URL"')

The SCOPE Element is used to specify the depth of the search. See the SCOPE Element topic for more information about this optional statement.

See Also

Other Resources

SCOPE Element
SELECT Statement