Neoview Guide to Stored Procedures in Java (R2.3, R2.4)

8 Performance and Troubleshooting..............................................................................73
Troubleshooting Common Problems....................................................................................................73
Performance Tip....................................................................................................................................73
Displaying an Execution Plan of a CALL Statement............................................................................73
Using the EXPLAIN Statement.......................................................................................................74
Using the EXPLAIN Function.........................................................................................................75
A Sample SPJs..................................................................................................................77
Procedures in the SALES Schema.........................................................................................................77
LOWERPRICE Procedure................................................................................................................78
Java Method: lowerPrice()..........................................................................................................78
Creating the Procedure: LOWERPRICE....................................................................................78
Calling the Procedure: LOWERPRICE.......................................................................................79
DAILYORDERS Procedure..............................................................................................................80
Java Method: numDailyOrders()...............................................................................................80
Creating the Procedure: DAILYORDERS...................................................................................80
Calling the Procedure: DAILYORDERS.....................................................................................81
MONTHLYORDERS Procedure......................................................................................................82
Java Method: numMonthlyOrders()..........................................................................................82
Creating the Procedure: MONTHLYORDERS...........................................................................82
Calling the Procedure: MONTHLYORDERS.............................................................................83
TOTALPRICE Procedure.................................................................................................................84
Java Method: totalPrice()............................................................................................................84
Creating the Procedure: TOTALPRICE......................................................................................84
Calling the Procedure: TOTALPRICE........................................................................................85
PARTDATA Procedure....................................................................................................................86
Java Method: partData().............................................................................................................86
Creating the Procedure: PARTDATA.........................................................................................87
Calling the Procedure: PARTDATA...........................................................................................88
ORDERSUMMARY Procedure........................................................................................................90
Java Method: orderSummary()..................................................................................................90
Creating the Procedure: ORDERSUMMARY............................................................................91
Calling the Procedure: ORDERSUMMARY...............................................................................91
Procedures in the PERSNL Schema......................................................................................................92
ADJUSTSALARY Procedure...........................................................................................................93
Java Method: adjustSalary().......................................................................................................93
Creating the Procedure: ADJUSTSALARY................................................................................93
Calling the Procedure: ADJUSTSALARY..................................................................................94
EMPLOYEEJOB Procedure..............................................................................................................95
Java Method: employeeJob()......................................................................................................95
Creating the Procedure: EMPLOYEEJOB..................................................................................95
Calling the Procedure: EMPLOYEEJOB.....................................................................................95
PROJECTTEAM Procedure.............................................................................................................97
Java Method: projectTeam().......................................................................................................97
Creating the Procedure: PROJECTTEAM..................................................................................97
Calling the Procedure: PROJECTTEAM....................................................................................97
TOPSALESREPS Procedure............................................................................................................98
Java Method: topSalesReps()......................................................................................................98
Creating the Procedure: TOPSALESREPS.................................................................................98
Calling the Procedure: TOPSALESREPS...................................................................................99
Procedures in the INVENT Schema....................................................................................................100
SUPPLIERINFO Procedure...........................................................................................................101
Java Method: supplierInfo().....................................................................................................101
Creating the Procedure: SUPPLIERINFO................................................................................101
Table of Contents 5