I have the following code that links to 2 different MS SQL servers and the results are imported into an Oracle 11gR2 database.
SELECT WorkgroupDVAudit.Workgroup_Name,
AAS.User_Id,
AAS.LoginTime,
AAS.NotReadyTime,
AAS.IdleTime,
MAS.WrapTime,
MAS.PreviewTime,
MAS.ActiveTime,
MAS.HoldTime,
MAS.InboundCalls,
MAS.OutboundCalls,
MAS.ManualCalls,
MAS.TransferredCalls,
MAS.WrapCalls,
AAS.LoginDate
FROM N2UIPRIDATA01\UIP_CONFIG (CcproQuery), config_epro
.config_epro.dbo.WorkgroupDVAudit WorkgroupDVAudit
INNER JOIN
(SELECT lower(AgentActivitySummary.User_Id) AS User_Id,
AgentActivitySummary.WorkGroup_Id,
SUM(
AgentActivitySummary.TotalLoginTime
- ISNULL(TotalGapTime, 0))
AS LoginTime,
SUM(TotalNotreadyTime) AS NotReadyTime,
SUM(TotalIdleTime) AS IdleTime,
CAST(CONVERT(varchar,AgentActivitySummary.BeginTimePeriodDt,101) AS Date) AS LoginDate
FROM N2UIREPDATA01\UIP_REPORTING (CcproQuery), summary_epro
.summary_epro.dbo.AgentActivitySummary AgentActivitySummary
WHERE AgentActivitySummary.LoginDt = ‘’ /Yesterday/
AND AgentActivitySummary.Service_Id = 0
GROUP BY AgentActivitySummary.WorkGroup_Id,
AgentActivitySummary.User_Id,
CONVERT(varchar,AgentActivitySummary.BeginTimePeriodDt,101)) AAS
ON (AAS.WorkGroup_Id = WorkgroupDVAudit.WorkGroup_Id)
LEFT OUTER JOIN
(SELECT lower(MediaAgentSummary.User_Id) AS User_Id,
MediaAgentSummary.WorkGroup_Id,
SUM(CASE WHEN CallTypeId IN (1,25) THEN TotalAgentCalls ELSE 0 END) AS InboundCalls,
SUM(CASE WHEN CallTypeId NOT IN (1,25) THEN TotalAgentCalls ELSE 0 END) AS OutboundCalls,
SUM(CASE WHEN CallTypeId IN (9) THEN TotalAgentCalls ELSE 0 END) AS ManualCalls,
SUM(CASE WHEN CallActionId IN (3,18,19,35) THEN TotalAgentCalls ELSE 0 END) AS TransferredCalls,
SUM(WrapActiveCount) As WrapCalls,
SUM(WrapTime) AS WrapTime,
SUM(PreviewTime) AS PreviewTime,
SUM(ActiveTime) AS ActiveTime,
SUM(HoldTime) AS HoldTime,
CAST(CONVERT(varchar,MediaAgentSummary.BeginTimePeriodDt,101) AS Date) AS CallDate
FROM N2UIREPDATA01\UIP_REPORTING (CcproQuery), summary_epro
.summary_epro.dbo.MediaAgentSummary MediaAgentSummary
WHERE MediaAgentSummary.BeginTimePeriodDt = ‘’ /Yesterday/
GROUP BY MediaAgentSummary.WorkGroup_Id, MediaAgentSummary.User_Id, CONVERT(varchar,MediaAgentSummary.BeginTimePeriodDt,101)) MAS
ON ( AAS.User_Id = MAS.User_Id
AND AAS.WorkGroup_Id = MAS.WorkGroup_Id AND AAS.LoginDate = MAS.CallDate)
ORDER BY Workgroup_Name, User_Id, LoginDate
Up until 4/1/2014 this worked perfectly in an automated task. Now it returns no data at all.
If I take the portions of code and run them on a direct connect to the database in question, I get results.
On a possibly related note, the automation runs on a box with TOAD DA Pro 3.2 – when I create a heterogeneous query editor on that machine, I get a SAXParseException