Created On:  30 March 2012

Problem:

Is it possible to create a report or SQL query that will return the last time a specific named user logged in to StarTeam?

Resolution:

SQL Database Query

SELECT
  Full_Name AS [Full Name],
  dbo.convertSTTimestamp(MAX(Timestamp)) AS [Last Logon Time]
FROM
  syn_ObjectSecurityLog, syn_User
WHERE
  LicenseType = 2 AND UserID = syn_User.ID
GROUP BY
  Full_Name

The following table lists the possible values for license types for SQL server.

LicenseType  Value 
Concurrent 1
Named 2
FlexLM / Belise 3


Oracle Database Query

SELECT
  Full_Name AS "Full Name",
  convertSTTimestamp(MAX(Timestamp)) AS "Last Logon Time"
FROM
  syn_ObjectSecurityLog, syn_User
WHERE
  LicenseType = 2 AND UserID = syn_User.ID
GROUP BY
  Full_Name

The following table lists the possible values for license types for Oracle.

LicenseType  Value 
Concurrent 2
Named 1
FlexLM / Belise 3

The values for named and concurrent are swapped in Oracle.

Incident #2565030