The following articles mainly introduce how to correctly use the relevant cursor in the Oracle stored procedure, and how to correctly create an array of Oracle, we all know that in the Oracle stored procedure, we can create something similar to an array. The following describes the specific content of this article.
- Type arr is table of varchar2(5) index by binary integer;
For example, you can put each row of data obtained by using a cursor into an array.
- TYPE V_TABLE1 IS TABLE OF cur1%ROWTYPE INDEX BY PLS_INTEGER;
% ROWTYPE:
This indicates that the row data type stores a row of data. A row of data can contain multiple columns, similar to a row of data in the table or a row of data in the cursor, for example:
- Vs_row1 table % rowtype;
- Vs_row2 cursor % rowtype;
PLS_INTEGER:
Both Binary_Integer and Pls_Integer are integer. The calculation of Binary_Integer variable values is performed by Oracle without Overflow, but the execution speed is slow because it is simulated by Oracle. The execution of Pls_Integer is performed by the hardware, that is, directly by the CPU. Therefore, overflow occurs, but the execution speed is much faster than that of Pls_Integer.
The above content describes how to use a cursor in the Oracle stored procedure. I hope it will help you in this regard.
Article by: http://kongbei888.blog.163.com/blog/static/243266132010218104021496/