DatabaseProcApplicationCreatedLinks
sybsystemprocssp_jdbc_convert_datatype  31 Aug 14Defects Dependencies

1     /** SECTION END: CLEANUP **/
2     
3     create procedure sp_jdbc_convert_datatype(
4         @source int,
5         @destination int)
6     as
7     
8         if @@trancount = 0
9         begin
10            set chained off
11        end
12    
13        set transaction isolation level 1
14    
15        /* Make source non-negative */
16        select @source = @source + 7
17        /* Put the strange date numbers into this area between 0-19*/
18        if (@source > 90)
19            select @source = @source - 82
20    
21        /*Convert destination the same way*/
22        /* Put the strange date numbers into this area between 0-19*/
23        if (@destination > 90)
24            select @destination = @destination - 82
25    
26        /* Need 8 added instead of 7 because substring starts at 1 instead */
27        /* of 0 */
28        select @destination = @destination + 8
29    
30        /* Check the conversion. If the bit string in the table has a 1 
31        ** on the place's number of the destination's value we have to 
32        ** return true, else false
33        */
34        if ((select substring(conversion, @destination, 1)
35                    from master.dbo.spt_jdbc_conversion
36                    where datatype = @source) = '1')
37    
38            select 1
39        else
40            select 0
41    


exec sp_procxmode 'sp_jdbc_convert_datatype', 'AnyMode'
go

Grant Execute on sp_jdbc_convert_datatype to public
go
RESULT SETS
sp_jdbc_convert_datatype_rset_002
sp_jdbc_convert_datatype_rset_001

DEFECTS
 TNOI 4 Table with no index master..spt_jdbc_conversion master..spt_jdbc_conversion
 MGTP 3 Grant to public master..spt_jdbc_conversion  
 MGTP 3 Grant to public sybsystemprocs..sp_jdbc_convert_datatype  
 MUCO 3 Useless Code Useless Brackets in create proc 3
 MUCO 3 Useless Code Useless Brackets 18
 MUCO 3 Useless Code Useless Brackets 23
 MUCO 3 Useless Code Useless Brackets 34
 QCRS 3 Conditional Result Set 38
 QCRS 3 Conditional Result Set 40
 QISO 3 Set isolation level 13
 QNAM 3 Select expression has no name 1 38
 QNAM 3 Select expression has no name 0 40
 MRST 2 Result Set Marker 38
 MRST 2 Result Set Marker 40
 MSUB 2 Subquery Marker 34
 MTR1 2 Metrics: Comments Ratio Comments: 34% 3
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 5 = 4dec - 1exi + 2 3
 MTR3 2 Metrics: Query Complexity Complexity: 19 3

DEPENDENCIES
PROCS AND TABLES USED
reads table master..spt_jdbc_conversion (1)