AS SELECT IdmsSubschemaRecords.ID, IdmsSubschemaRecords.RecordName, 
	Occurrences.StartRow, 
	Occurrences.EndRow,
	Occurrences.StartCol, 
	Occurrences.EndCol, 
	Paths.PathStr, 
	IdmsSchema.ID as SchemaID, 
	ddcle.id as RecordInDDCLID,
	ddclepa.PathStr as DDCLElementPath,
	ddclesi.StartRow as DDCLElemInfoStartRow, 
	ddclesi.EndRow as DDCLElemInfoEndRow, 
	ddclesi.StartCol as DDCLElemInfoStartCol, 
	ddclesi.EndCol as DDCLElemInfoEndCol
	from 
  	IdmsSubschemaRecords left join IdmsSchemaRecords on IdmsSchemaRecords.RecordName = IdmsSubschemaRecords.RecordName
  	left join Occurrences on Occurrences.OccurID = IdmsSchemaRecords.OccurId
  	left JOIN paths on paths.PathID = Occurrences.PathID 
  	left join IdmsSubschema on IdmsSubschema.ID = IdmsSubschemaRecords.SubschemaId
	left join IdmsSchema on IdmsSchema.ID = IdmsSubschema.SchemaId
	 left join DDCLElement ddcle on ddcle.name = IdmsSubschemaRecords.RecordName and ddcle.ddstypeid = 3
	 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 IdmsSubschemaRecords.ID IN (Select * from #numeric_param_temp)