The Relationship between table and table messed up Rd, remember a bug in procedure

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.