DatabaseProcApplicationCreatedLinks
sybsystemprocssp_help_query_tuning  31 Aug 14Defects Dependencies

1     
2     /*
3     ** Generated by spgenmsgs.pl on Tue Dec 19 13:40:33 2006 
4     */
5     /*
6     ** raiserror Messages for help_query_tuning [Total 1]
7     **
8     ** 19618, "Unsupported command '%1!'. Check command and retry sp_query_tuning."
9     */
10    /*
11    ** sp_getmessage Messages for help_query_tuning [Total 9]
12    **
13    ** 19348, "help - get help on a command"
14    ** 19619, "Usage: sp_query_tuning [ 'command' [, '@arg1' [, '@arg2' [, '@arg3' ] ] ] ]"
15    ** 19620, "flush - flush all query_tuning metrics from memory to system tables"
16    ** 19621, "drop - drop a query_tuning object or a query_tuning ID or a group of query_tuning objects"
17    ** 19622, "show - display the query_tuning status in each query_tuning group"
18    ** 19623, "Usage: sp_query_tuning 'help' [, 'command' ]"
19    ** 19624, "Usage: sp_query_tuning flush"
20    ** 19625, "Usage: sp_query_tuning 'drop', '@gid' [, '@id' [, '@lrnid' ] ]"
21    ** 19626, "Usage: sp_query_tuning show, ase125_better_plans|ase15_better_plans|query_tuning_objects|aborted_query_tuning_plans"
22    */
23    /*
24    ** End spgenmsgs.pl output.
25    */
26    
27    /*
28    ** sp_help_query_tuning displays usage information for query_tuning optimizer
29    ** related stored procedures
30    */
31    create procedure sp_help_query_tuning
32        @cmdtype varchar(30) = NULL
33    as
34        declare @msg varchar(250)
35    
36        if (@cmdtype is NULL)
37        begin
38            exec sp_getmessage 19619, @msg output print @msg
39            print " "
40            print "Command list:"
41    
42            exec sp_getmessage 19348, @msg output print @msg
43            exec sp_getmessage 19620, @msg output print @msg
44            exec sp_getmessage 19621, @msg output print @msg
45            exec sp_getmessage 19622, @msg output print @msg
46            print " "
47    
48            return 0
49        end
50    
51        if (@cmdtype = 'help')
52        begin
53            exec sp_getmessage 19623, @msg output print @msg
54            return 0
55        end
56    
57        if (@cmdtype = 'flush')
58        begin
59            exec sp_getmessage 19624, @msg output print @msg
60            return 0
61        end
62    
63        if (@cmdtype = 'drop')
64        begin
65            exec sp_getmessage 19625, @msg output print @msg
66            return 0
67        end
68    
69        if (@cmdtype = 'show')
70        begin
71            exec sp_getmessage 19626, @msg output print @msg
72            return 0
73        end
74    
75        raiserror 19618, @cmdtype
76    
77        return 1
78    


exec sp_procxmode 'sp_help_query_tuning', 'AnyMode'
go

Grant Execute on sp_help_query_tuning to public
go
DEFECTS
 MGTP 3 Grant to public sybsystemprocs..sp_help_query_tuning  
 MNER 3 No Error Check should check return value of exec 38
 MNER 3 No Error Check should check return value of exec 42
 MNER 3 No Error Check should check return value of exec 43
 MNER 3 No Error Check should check return value of exec 44
 MNER 3 No Error Check should check return value of exec 45
 MNER 3 No Error Check should check return value of exec 53
 MNER 3 No Error Check should check return value of exec 59
 MNER 3 No Error Check should check return value of exec 65
 MNER 3 No Error Check should check return value of exec 71
 MUCO 3 Useless Code Useless Brackets 36
 MUCO 3 Useless Code Useless Brackets 51
 MUCO 3 Useless Code Useless Brackets 57
 MUCO 3 Useless Code Useless Brackets 63
 MUCO 3 Useless Code Useless Brackets 69
 MTR1 2 Metrics: Comments Ratio Comments: 53% 31
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 1 = 5dec - 6exi + 2 31
 MTR3 2 Metrics: Query Complexity Complexity: 40 31

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_getmessage  
   reads table sybsystemprocs..sysusermessages  
   reads table master..sysmessages (1)  
   reads table master..syslanguages (1)  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)  

CALLERS
called by proc sybsystemprocs..sp_query_tuning