is a 6-sheet association query that writes a stored procedure that uses 4-layer for to handle
Bug
In the last for, the two tables have one less association condition, and the result data is much more checked.
Troubleshooting methods:
Use Dbms_output.printline (");
Add one for each for
Dbms_output.put_line ('-3, ' | | X.name);//Print out the key information associated with the lower for
Dbms_output.put_line ('-2, ' | | X.name);//Print out the key information associated with the lower for
Dbms_output.put_line ('-1, ' | | X.name);//Print out the key information associated with the lower for
Dbms_output.put_line (' 0, ' | | X.name);//Print out the key information associated with the lower for
And then, the clues.
Then call this stored procedure in the Commnad window to get the print information
SQL>seton SQL>exec sum_num (3,1256) ;
Summarize:
function has to be carefully verified, different angles can be found problems
To use Dbms_output.put_line to output the statement, you encounter the following error:
Begin User_priv (username = ' hr '); End
Ora-20000:oru-10027:buffer overflow, limit of $ bytes
Ora-06512:at "SYS. Dbms_output ", line 32
Ora-06512:at "SYS. Dbms_output ", line 97
Ora-06512:at "SYS. Dbms_output ", line 112
Ora-06512:at "HR. User_priv ", line 20
Ora-06512:at Line 2
Obviously when we output, the buffer size of the control output is determined by the dbms_output. Enable control, buffer size defaults to 20000, the maximum limit per row is 32k, followed by an example is to show that the stored procedure is to cache all the data before returning the results. So when we use cursors for output, if the result is a lot, it will exceed this value ORA-20000, oru-10027:buffer overflow, limit of <buf_limit> bytes this error
Workaround:
After the stored procedure begin, add: Dbms_output. ENABLE (buffer_size=>null) means there is no limit.
Stored Procedure User_priv Please refer to the documentation: http://www.cnblogs.com/AlbertCQY/archive/2013/03/31/2992471.html
http://blog.csdn.net/u010033674/article/details/8744588
Table-to-table relationships confuse Rd with a bug in procedure