DatabaseProcApplicationCreatedLinks
sybsystemprocssp_jdbc_search_lob  31 Aug 14Defects Dependencies

1     /** SECTION END: CLEANUP **/
2     
3     create procedure sp_jdbc_search_lob(
4         @lob_type int,
5         @search varbinary(16384),
6         @locator binary(24),
7         @pos bigint,
8         @result bigint output,
9         @isPattern int = 0,
10        @searchString varchar(16384) = null)
11    as
12        if @lob_type = 0
13            if @isPattern = 0
14                select @result = charindex(locator_literal(IMAGE_locator, @search), substring(locator_literal(IMAGE_locator, @locator), @pos, datalength(locator_literal(IMAGE_locator, @locator)) - @pos + 1)) + @pos - 1
15            else
16                select @result = charindex(@search, substring(locator_literal(IMAGE_locator, @locator), @pos, datalength(locator_literal(IMAGE_locator, @locator)) - @pos + 1)) + @pos - 1
17        else if @lob_type = 1
18            if @isPattern = 0
19                select @result = charindex(locator_literal(TEXT_locator, @search), substring(locator_literal(TEXT_locator, @locator), @pos, char_length(locator_literal(TEXT_locator, @locator)) - @pos + 1)) + @pos - 1
20            else
21                select @result = charindex(@searchString, substring(locator_literal(TEXT_locator, @locator), @pos, char_length(locator_literal(TEXT_locator, @locator)) - @pos + 1)) + @pos - 1
22        else
23        if @isPattern = 0
24            select @result = charindex(locator_literal(UNITEXT_locator, @search), substring(locator_literal(UNITEXT_locator, @locator), @pos, char_length(locator_literal(UNITEXT_locator, @locator)) - @pos + 1)) + @pos - 1
25        else
26            select @result = charindex(@searchString, substring(locator_literal(UNITEXT_locator, @locator), @pos, char_length(locator_literal(UNITEXT_locator, @locator)) - @pos + 1)) + @pos - 1
27    


exec sp_procxmode 'sp_jdbc_search_lob', 'AnyMode'
go

Grant Execute on sp_jdbc_search_lob to public
go
DEFECTS
 PERR 6 Parsing Error Could not find COLUMN IMAGE_locator in the query's tables 14
 PERR 6 Parsing Error Could not find COLUMN IMAGE_locator in the query's tables 16
 PERR 6 Parsing Error Could not find COLUMN TEXT_locator in the query's tables 19
 PERR 6 Parsing Error Could not find COLUMN TEXT_locator in the query's tables 21
 PERR 6 Parsing Error Could not find COLUMN UNITEXT_locator in the query's tables 24
 PERR 6 Parsing Error Could not find COLUMN UNITEXT_locator in the query's tables 26
 MGTP 3 Grant to public sybsystemprocs..sp_jdbc_search_lob  
 MUCO 3 Useless Code Useless Brackets in create proc 3
 QAFM 3 Var Assignment from potentially many rows 14
 QAFM 3 Var Assignment from potentially many rows 16
 QAFM 3 Var Assignment from potentially many rows 19
 QAFM 3 Var Assignment from potentially many rows 21
 QAFM 3 Var Assignment from potentially many rows 24
 QAFM 3 Var Assignment from potentially many rows 26
 MTR1 2 Metrics: Comments Ratio Comments: 1% 3
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 6 = 5dec - 1exi + 2 3
 MTR3 2 Metrics: Query Complexity Complexity: 17 3

DEPENDENCIES