AS SELECT IdmsSubschemaSets.ID, IdmsSubschemaSets.SetName, 
    Occurrences.StartRow, Occurrences.EndRow,
	Occurrences.StartCol, Occurrences.EndCol, 
	Paths.PathStr, 
	IdmsSchema.ID as SchemaID, 
	ddcle.id as SetInDDCLID,
	ddclepa.PathStr as DDCLElementPath,
	ddclesi.StartRow as DDCLElemInfoStartRow, 
	ddclesi.EndRow as DDCLElemInfoEndRow, 
	ddclesi.StartCol as DDCLElemInfoStartCol, 
	ddclesi.EndCol as DDCLElemInfoEndCol
FROM 
  	IdmsSubschemaSets left join IdmsSchemaSets on IdmsSchemaSets.SetName = IdmsSubschemaSets.SetName
  	left join Occurrences on Occurrences.OccurID = IdmsSchemaSets.OccurId
  	left JOIN paths on paths.PathID = Occurrences.PathID 
  	left join IdmsSubschema on IdmsSubschema.ID = IdmsSubschemaSets.SubschemaId
	left join IdmsSchema on IdmsSchema.ID = IdmsSubschema.SchemaId
     left join DDCLElement ddcle on ddcle.name = IdmsSubschemaSets.SetName and ddcle.ddstypeid = 10
	 left join DDCLSourceInfo ddclesi on ddclesi.Id = ddcle.SourceInfo
     left join Programs ddclep on ddclep.ProgramId = ddclesi.ProgramId
     left join Occurrences ddcleo on ddcleo.OccurId = ddclep.OccurId
     left join Paths ddclepa on ddclepa.PathId = ddcleo.PathId
where IdmsSubschemaSets.ID IN (Select * from #numeric_param_temp)