DatabaseProcApplicationCreatedLinks
sybsystemprocssp_odbc_server_info  14 déc. 14Defects Propagation Dependencies

1     
2     
3     /* Sccsid = "%Z% generic/sproc/%M% %I% %G%" */
4     
5     /*
6     ** Messages for "sp_odbc_server_info"
7     **
8     ** 18059, "Attribute id %1! is not supported."
9     */
10    
11    CREATE OR REPLACE PROCEDURE sp_odbc_server_info
12        @attribute_id int = NULL /* optional attribute id */
13    as
14    
15    
16        set nocount on
17    
18        /* If an attribute id was specified then just return the info for that
19        ** attribute.
20        */
21        if @attribute_id is not null
22        begin
23            /* Verify that the attribute is valid. */
24            if not exists (select attribute_id
25                    from sybsystemprocs.dbo.spt_server_info
26                    where attribute_id = @attribute_id)
27            begin
28                /*
29                ** 18059, "Attribute id %1! is not supported."
30                */
31                raiserror 18059, @attribute_id
32                return (1)
33            end
34    
35            /* Adaptive Server has expanded all '*' elements in the following statement */ select sybsystemprocs.dbo.spt_server_info.attribute_id, sybsystemprocs.dbo.spt_server_info.attribute_name, sybsystemprocs.dbo.spt_server_info.attribute_value from sybsystemprocs.dbo.spt_server_info
36            where attribute_id = @attribute_id
37        end
38    
39        /* If no attribute was specified then return info for all supported
40        ** attributes.
41        */
42        else
43        begin
44            /* Adaptive Server has expanded all '*' elements in the following statement */ select sybsystemprocs.dbo.spt_server_info.attribute_id, sybsystemprocs.dbo.spt_server_info.attribute_name, sybsystemprocs.dbo.spt_server_info.attribute_value from sybsystemprocs.dbo.spt_server_info
45        end
46    
47        return (0)
48    


exec sp_procxmode 'sp_odbc_server_info', 'AnyMode'
go

Grant Execute on sp_odbc_server_info to public
go
RESULT SETS
sp_odbc_server_info_rset_002
sp_odbc_server_info_rset_001

DEFECTS
 TNOI 4 Table with no index sybsystemprocs..spt_server_info sybsystemprocs..spt_server_info
 MGTP 3 Grant to public sybsystemprocs..sp_odbc_server_info  
 MUCO 3 Useless Code Useless Brackets 32
 MUCO 3 Useless Code Useless Brackets 47
 QCRS 3 Conditional Result Set 35
 QCRS 3 Conditional Result Set 44
 MRST 2 Result Set Marker 35
 MRST 2 Result Set Marker 44
 MSUB 2 Subquery Marker 24
 MTR1 2 Metrics: Comments Ratio Comments: 37% 11
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 3 = 3dec - 2exi + 2 11
 MTR3 2 Metrics: Query Complexity Complexity: 16 11

DEPENDENCIES
PROCS AND TABLES USED
writes table sybsystemprocs..sp_odbc_server_info_rset_002 
reads table sybsystemprocs..spt_server_info  
writes table sybsystemprocs..sp_odbc_server_info_rset_001