DatabaseProcApplicationCreatedLinks
sybsystemprocssp_errorlog_showhelp  31 Aug 14Defects Dependencies

1     
2     
3     /*
4     ** raiserror Messages for sp_errorlog
5     **
6     ** 17260, "Can't run %1! from within a transaction."
7     ** 17925, "You entered an invalid option name. No change was made."
8     ** 17932, "You entered an invalid value. No change was made."
9     ** 19213, "Invalid argument or unsupported command: %1!."
10    ** 19847, "File '%1!' did not open for writing."
11    ** 19848, "Command already in use by another user or session."
12    ** 19850  "Internal error encountered in opening a new ASE error log. Check 
13    **	   current ASE error log for details." 
14    */
15    
16    /*
17    ** sp_getmessage Messages for sp_errorlog
18    ** 
19    ** 18954, "Usage:"
20    ** 19541, "Examples:"
21    ** 19539, "For more information, use:"
22    ** 19845, "Change in error log path complete. New file: '%1!'." 
23    ** 19846, "Update the -e argument in the runserver file with the new ASE error log 
24    **	   path to reflect the error log change."
25    ** 19849, "Command is used to dynamically switch to a new ASE error log at 
26    ** 	   location ." 
27    ** 19851, "Warning : Previous ASE error log file could not be closed." 
28    ** 19852, "Attempting to change the Job Scheduler Agent log from its current 
29    **         directory to the directory where new ASE error log is residing. 
30    **	   Check the JS Agent log and/or the new ASE error log for details."
31    ** 19853, "The Job Scheduler log is not running; therefore, no attempt made 
32    **         to change the location of JS Agent log"
33    ** 19854, "If 'jslog true' - ASE will attempt to change JS Agent error log 
34    ** 	   to the same directory where the new ASE error log is residing 
35    **	   provided that the JS Agent is running. Success or failure of 
36    **	   command is reported in the JS Agent log and/or the new ASE error log."
37    ** 19855, "If 'jslog false' - ASE will not attempt to change the log location of
38    **	   the Job Scheduler. Note that 'jslog true' is the deault option."
39    ** 19856, "Error encountered when moving the Job Scheduler Agent log from its
40    **	   current directory to the directory where the new ASE error log is
41    **	   residing.Check the previous JS Agent log and/or ASE error log for details."
42    */
43    
44    /*
45    ** SP_ERRORLOG_SHOWHELP
46    **
47    ** The sub-procedure to print help/usage information for the sp_errorlog
48    ** procedure. Called by sp_errorlog
49    **
50    ** Parameters
51    **	@cmd          -	This is set to either null or 'help'.
52    **			If @cmd is null   - General help/usage information is printed
53    **			If @cmd is 'help' - Specific help/usage information is printed
54    **		        depending on command and subcommand 
55    **      @command      -	Command for which help information is to be provided
56    **			Currently valid command is only 'change log'
57    **	@subcommand   - Sub-command for which help information is to be provided 
58    **		 	Is either 'jslog true' or 'jslog false' or null
59    **
60    ** Returns 
61    **      0	      - success
62    **      1             - unsupported or invalid command
63    */
64    
65    create procedure sp_errorlog_showhelp
66    (
67        @cmd varchar(30) = NULL,
68        @command varchar(30) = NULL,
69        @subcommand varchar(30) = NULL
70    )
71    as
72        begin
73            declare @retval int,
74                @msg varchar(256)
75    
76            if ((@command is null) and (@subcommand is null))
77            begin
78                /* give generic help */
79                exec sp_getmessage 18954, @msg output
80                print @msg
81                print "sp_errorlog 'help','change log'"
82                print ""
83    
84                exec sp_getmessage 18954, @msg output
85                print @msg
86                print "sp_errorlog 'change log', '<new_path>'[,{'jslog true'|'jslog false'}]"
87                print ""
88    
89                return (0)
90            end
91            else if ((@command = 'change log') and (@subcommand in ('jslog true', 'jslog false', null)))
92            begin
93                /*
94                ** 19849, "Command is used to dynamically switch to a new errorlog 
95                **  	   at ocation ." 
96                */
97                exec sp_getmessage 19849, @msg output
98                print @msg
99                /* 
100               ** 19846, Update the -e argument in the Runserver file with the
101               ** new errorlog path to reflect the errorlog change." 
102               */
103               exec sp_getmessage 19846, @msg output
104               print @msg
105               print ""
106   
107               exec sp_getmessage 18954, @msg output
108               print @msg
109   
110               print "sp_errorlog 'change log','<new_path>' [,{'jslog true'|'jslog false'}]"
111               print ""
112   
113               /* 
114               ** 19854, "If 'jslog true' - ASE will attempt to change JS Agent
115               ** 	   error log to the same directory where the new ASE 
116               **	   error log is residing provided that the JS Agent is
117               **	   running. Success or failure of command is reported in 
118               **	   the JS Agent log and/or the new ASE error log. 
119               */
120               exec sp_getmessage 19854, @msg output
121               print @msg
122   
123               /*
124               ** 19855, "If 'jslog false' - ASE will not attempt to change the   
125               **	   log location of the Job Scheduler. Note that 'jslog true' 
126               **	   is the default option."
127               */
128               exec sp_getmessage 19855, @msg output
129               print @msg
130   
131           end
132           else
133           begin
134               /* 19213, "Invalid argument or unsupported command: %1!." */
135               raiserror 19213, @cmd
136               return 1
137           end
138       end
139   


exec sp_procxmode 'sp_errorlog_showhelp', 'AnyMode'
go

Grant Execute on sp_errorlog_showhelp to public
go
DEFECTS
 MEST 4 Empty String will be replaced by Single Space 82
 MEST 4 Empty String will be replaced by Single Space 87
 MEST 4 Empty String will be replaced by Single Space 105
 MEST 4 Empty String will be replaced by Single Space 111
 MGTP 3 Grant to public sybsystemprocs..sp_errorlog_showhelp  
 MNER 3 No Error Check should check return value of exec 79
 MNER 3 No Error Check should check return value of exec 84
 MNER 3 No Error Check should check return value of exec 97
 MNER 3 No Error Check should check return value of exec 103
 MNER 3 No Error Check should check return value of exec 107
 MNER 3 No Error Check should check return value of exec 120
 MNER 3 No Error Check should check return value of exec 128
 MUCO 3 Useless Code Useless Brackets in create proc 66
 MUCO 3 Useless Code Useless Begin-End Pair 72
 MUCO 3 Useless Code Useless Brackets 76
 MUCO 3 Useless Code Useless Brackets 89
 MUCO 3 Useless Code Useless Brackets 91
 VUNU 3 Variable is not used @retval 73
 MTR1 2 Metrics: Comments Ratio Comments: 67% 65
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 3 = 4dec - 3exi + 2 65
 MTR3 2 Metrics: Query Complexity Complexity: 32 65

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_errorlog