From 75ba1b2b2e5884cf25fae5938f13976dffab5765 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 7 Jan 2011 16:02:23 +0000 Subject: [PATCH] --- PROMS/SQL/PROMS2010.SQL | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/PROMS/SQL/PROMS2010.SQL b/PROMS/SQL/PROMS2010.SQL index 7ce4d13d..56cefcf7 100644 --- a/PROMS/SQL/PROMS2010.SQL +++ b/PROMS/SQL/PROMS2010.SQL @@ -11627,6 +11627,11 @@ IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_FindText]') DROP FUNCTION [vefn_FindText]; GO +/* +SELECT * From vefn_FindText('1','turbine-driven',0,0,0,1,'') +SELECT * From vefn_FindText('1','turbine\u8209?driven',0,0,0,0,'') +SELECT * From vefn_FindText('1','trip',0,0,0,0,'') +*/ CREATE FUNCTION [dbo].[vefn_FindText]( @DocVersionList nvarchar(MAX) ,@SearchString varchar(MAX) @@ -11654,12 +11659,14 @@ IF isnull(@SearchString,'')='' (dbo.vefn_AllSections(C.Type) in (Select ID from vefn_SplitInt(@StepTypeList,','))) END ELSE + Declare @SearchStringx nvarchar(200) --kbr + set @SearchStringx = replace(@SearchString,'-','\u8209?') --kbr IF @CaseSensitive = 0 -- Not Case Sensitive BEGIN insert into @FoundContents - select C.ContentID from vefn_FindContentText(@DocVersionList,@SearchString) C + select C.ContentID from vefn_FindContentText(@DocVersionList,@SearchStringx) C where - (.dbo.vefn_RemoveExtraText(C.Text,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) like @SearchString Collate SQL_Latin1_General_CP1_CI_AS) + (.dbo.vefn_RemoveExtraText(C.Text,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) like @SearchStringx Collate SQL_Latin1_General_CP1_CI_AS) AND ((isnull(@StepTypeList,'') = '' and dbo.vefn_AllSections(C.Type)>=10000) or ((dbo.vefn_AllSections(C.Type) in (Select ID from vefn_SplitInt(@StepTypeList,','))))) UNION select C.ContentID from (select * from Contents where ContentID in(select ContentID from vefn_DVContent(@DocVersionList))) C @@ -11675,9 +11682,9 @@ ELSE IF @CaseSensitive = 1 -- Case Sensitive BEGIN insert into @FoundContents - select C.ContentID from vefn_FindContentText(@DocVersionList,@SearchString) C + select C.ContentID from vefn_FindContentText(@DocVersionList,@SearchStringx) C where - (.dbo.vefn_RemoveExtraText(C.Text,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) like @SearchString Collate SQL_Latin1_General_CP1_CS_AS) + (.dbo.vefn_RemoveExtraText(C.Text,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) like @SearchStringx Collate SQL_Latin1_General_CP1_CS_AS) AND ((isnull(@StepTypeList,'') = '' and dbo.vefn_AllSections(C.Type)>=10000) or ((dbo.vefn_AllSections(C.Type) in (Select ID from vefn_SplitInt(@StepTypeList,','))))) UNION select C.ContentID from (select * from Contents where ContentID in(select ContentID from vefn_DVContent(@DocVersionList))) C @@ -11808,7 +11815,7 @@ BEGIN Set @SearchString = replace(@SearchString,'?','_') Set @SearchString = replace(@SearchString,'\%','*') Set @SearchString = replace(@SearchString,'\_','?') - Set @SearchString = replace(@SearchString,'-','[-'+nchar(8209)+']') + --Set @SearchString = replace(@SearchString,'-','[-'+nchar(8209)+']') IF(@SearchString like '[%]%') RETURN @SearchString IF(@SearchString like '%[%]') RETURN @SearchString RETURN '%' + @SearchString + '%' @@ -14061,6 +14068,7 @@ exec vesp_SearchItemAndChildren '','','(SG OR LHSI) AND DISPATCH',2,0,0,0 exec vesp_SearchItemAndChildren '','','DISPATCH NEAR SG',2,0,0,0 exec vesp_SearchItemAndChildren '','','PORV NEAR SG',2,0,0,0 exec vesp_SearchItemAndChildren '','','CHECK NORMAL',0,0,0,0 +exec vesp_SearchItemAndChildren '','','turbine-driven',0,0,0,0 */ CREATE PROCEDURE [dbo].[vesp_SearchItemAndChildren] (@DocVersionList varchar(MAX), @StepTypeList varchar(MAX), @SearchString varchar(MAX), @CaseSensitive as int, @IncludeLinks as int, @IncludeRtfFormatting as int, @IncludeSpecialCharacters as int) @@ -14213,6 +14221,7 @@ exec vesp_SearchItemAndChildrenNew '','','DISPATCH NEAR SG',2,0,0,0 exec vesp_SearchItemAndChildrenNew '','','PORV NEAR SG',2,0,0,0 exec vesp_SearchItemAndChildrenNew '','','CHECK NORMAL',0,0,0,0 exec vesp_SearchItemAndChildrenNew '','','(Resolved Transition Text)',0,0,0,0 +exec vesp_SearchItemAndChildrenNew '','','%turbine-driven%',0,0,0,0 */ CREATE PROCEDURE [dbo].[vesp_SearchItemAndChildrenNew] (@DocVersionList varchar(MAX), @StepTypeList varchar(MAX),