Jan 12, 2011

SQL Server

to change seconds to date use DATEADD function ie dateadd(s,run_start_time,'19700101')
NVL in ocl is used as ISNULL here and TRIM function won't be applicable to SQL Server.
Length function in Orcl is used as len(column_name)

SELECT ISNULL(UPPER(ltrim(rtrim(R.CorrelationToken))),-1) CorrelationToken,
       ISNULL(UPPER(ltrim(rtrim(R.EventID))),-1) EventID,
       ISNULL(UPPER(ltrim(rtrim(R.FlowPath))),-1) FlowPath,
       R.run_start_time,
       ISNULL(UPPER(ltrim(rtrim(R.flow_response))),-1) flow_response,
       ISNULL(UPPER(ltrim(rtrim(R.flow_return_code))),-1) flow_return_code,
       ISNULL(UPPER(ltrim(rtrim(R.wasResolved))),-1) wasResolved,
       ISNULL(UPPER(ltrim(rtrim(R.RBATimedOut))),-1) RBATimedOut,
       ISNULL(UPPER(ltrim(rtrim(R.RBAFinished))),-1) RBAFinished
  FROM RBA_Invocation_History  R
Where dateadd(s,run_start_time,'19700101') $$CDC_filter

No comments:

Post a Comment