• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
记得承诺过
博客园    首页    新随笔    联系   管理    订阅  订阅

Debugging of a SQR program

Debugging of a SQR program can be done in many ways. They are
 

 

·   Using SHOW /DISPLAY command

 

·   Using Compiler directives

 

·   Using command line FLAGS 
 
SHOW /DISPLAY command 

 

 

1) SHOW/DISPLAY Commands can be used any where expect in SETUP section

2) SHOW/DISPLAY Commands show the text and variable information on the screen and at the same time they redirect their information to log file

3) Difference between these two commands is SHOW can capable of showing more than one variable at a time. But DISPLAY command can be used to show only one variable at a time. See the following example

   Using SHOW 

 

Using DISPLAY

 

Log file looks like


 
 
Compiler directives  

 1) Combination of  #debug & -debug , Its used at the time of testing of a particular SQR program 

2) Any thing that follows #debug in the program needs to have -debug in the command line flags to compile further , #debug can be appended more than one number or letter its like 
          
            #Debugx show 'Program started'

        -> This statement can be compiled only when -Debugx is specified in flags 

     #Debug    Show  'Select statement started'
        #Debuga  Show  'Employee Id '
        #Debugb  Show  'Employee Name'

       -> This statement can be compiled and information from SHOW can be printed in log file  if and only if the command line contains this flag -Debugab

3) Other compiler directives are 
        
          #Ifdef / #End-If 
          #Ifndef / #End-If
          #If / #Else / #End-If

These directives can be used to track the entire sections of code .This gives very clear idea in debugging 

 #Ifdef / #End-If
 
 
 
 In above part of coding we are able to track the complete section of code .This looks likes in the following way in the log file. Make sure that you have placed -debugx flag in the command line options .As I am running from process scheduler I have made the changes in Process(PeopleTools ->Process Scheduler)












Log file looks like

 

 

Using Command line Flags:
 

In addition to these , Some of the command line flags are very useful while in debugging . They are 


Flags
Purpose
-S
It shows the complete SQL statement status. It returns the following information
·         Text of each SQL statement
·         No of times compiled and executed
·         No of rows selected
-E
Creates the separate log file with the extension of .err of program name. Stores in the same path of program
-C
Create the cancel dialogue box
-Tnn
Only nn pages will be printed .

  

posted @ 2015-10-21 20:27  记得承诺过  阅读(194)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3