DatabaseProcApplicationCreatedLinks
sybsystemprocssp_odbc_server_info  31 Aug 14Defects Dependencies

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


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 31
 MUCO 3 Useless Code Useless Brackets 46
 QCRS 3 Conditional Result Set 34
 QCRS 3 Conditional Result Set 43
 MRST 2 Result Set Marker 34
 MRST 2 Result Set Marker 43
 MSUB 2 Subquery Marker 23
 MTR1 2 Metrics: Comments Ratio Comments: 37% 10
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 2 = 2dec - 2exi + 2 10
 MTR3 2 Metrics: Query Complexity Complexity: 16 10

DEPENDENCIES
PROCS AND TABLES USED
reads table sybsystemprocs..spt_server_info