DatabaseProcApplicationCreatedLinks
sybsystemprocssp_jdbc_getsupertypes  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     **  End of sp_jdbc_lob_length 
4     */
5     /* Don't delete the following line. This is where sp_jdbc_getsupertypes gets inserted. */
6     /*** ADDPOINT_GETSUPERTYPES ***/
7     /*
8     ** JDBC 3.0
9     **
10    ** DatabaseMetaData.getSuperTypes(catalog, schemaPattern, typeNamePattern)
11    **
12    */
13    
14    /** SECTION BEGIN: CLEANUP **/
15    
16    create or replace procedure sp_jdbc_getsupertypes(
17        @catalog varchar(32) = NULL,
18        @schemaPattern varchar(32) = NULL,
19        @typeNamePattern varchar(255))
20    as
21        if (@catalog is null) or (@catalog = '')
22            select @catalog = db_name()
23    
24        if (@schemaPattern is null) or (@schemaPattern = '')
25            select @schemaPattern = '%'
26    
27        if (@typeNamePattern is null)
28        begin
29            raiserror 17208
30                'Null is not allowed for parameter TYPE NAME PATTERN'
31            return (1)
32        end
33    
34        select
35            TYPE_CAT = @catalog,
36            TYPE_SCHEM = convert(varchar, b.name),
37            TYPE_NAME = convert(varchar, t.name),
38            SUPERTYPE_CAT = @catalog,
39            SUPERTYPE_SCHEM = 'dbo',
40            SUPERTYPE_NAME = convert(varchar, p.name)
41    
42        from systypes t, sysusers b, systypes p
43        where t.uid = b.uid
44            and t.usertype >= 100
45            and t.type = p.type
46            and p.usertype = (select min(usertype) from systypes where type = t.type)
47            and b.name like @schemaPattern
48            and t.name like @typeNamePattern
49    


exec sp_procxmode 'sp_jdbc_getsupertypes', 'AnyMode'
go

Grant Execute on sp_jdbc_getsupertypes to public
go
RESULT SETS
sp_jdbc_getsupertypes_rset_001

DEFECTS
 QJWI 5 Join or Sarg Without Index 45
 QJWI 5 Join or Sarg Without Index 46
 MEST 4 Empty String will be replaced by Single Space 21
 MEST 4 Empty String will be replaced by Single Space 24
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 44
 MGTP 3 Grant to public sybsystemprocs..sp_jdbc_getsupertypes  
 MGTP 3 Grant to public sybsystemprocs..systypes  
 MGTP 3 Grant to public sybsystemprocs..sysusers  
 MUCO 3 Useless Code Useless Brackets in create proc 16
 MUCO 3 Useless Code Useless Brackets 27
 MUCO 3 Useless Code Useless Brackets 31
 QNAJ 3 Not using ANSI Inner Join 42
 QNUA 3 Should use Alias: Table sybsystemprocs..systypes 46
 MRST 2 Result Set Marker 34
 MSUC 2 Correlated Subquery Marker 46
 MTR1 2 Metrics: Comments Ratio Comments: 17% 16
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 6 = 6dec - 2exi + 2 16
 MTR3 2 Metrics: Query Complexity Complexity: 25 16
 PRED_QUERY_COLLECTION 2 {t=sybsystemprocs..systypes, t2=sybsystemprocs..systypes, u=sybsystemprocs..sysusers} 0 34
 PRED_QUERY_COLLECTION 2 {t=sybsystemprocs..systypes, t2=sybsystemprocs..systypes} 0 46

DATA PROPAGATION detailed
ColumnWritten To
@catalogsp_jdbc_getsupertypes_rset_001.TYPE_CAT °.SUPERTYPE_CAT

DEPENDENCIES
PROCS AND TABLES USED
reads table sybsystemprocs..systypes  
reads table sybsystemprocs..sysusers  
writes table sybsystemprocs..sp_jdbc_getsupertypes_rset_001