1. The following Code creates a top100cur () function, which returns an anonymous cursor -- dropfunctiontop100cur (); createfunctiontop10
1. The following Code creates a top100cur () function, which returns an anonymous cursor -- drop function top100cur (); create function top10
1. The following Code creates a top100cur () function, which returns an anonymous cursor.
2. The following code will create a function and return a cursor named abc (Can you find the difference? Yes. Whether the cursor is anonymous depends on whether the cursor variable is bound to the open cursor) 3. Return the cursor named by the caller. 4. Return a cursor named $1. 5. Return an anonymous cursor. 6. Return the cursor specified by the caller. different? In 4 and 5, the cursor variable name declared by declare is too special, and the anonymous parameter name is hidden ......)
7. open a cursor variable that is neither declare nor passed in.
Summary:
1. declare variables will cause function parameters to be hidden (for example, after declare $1, the first anonymous parameter will be hidden );
2. declare only declares a cursor and does not open the cursor. A cursor without open is unavailable ~
3. When you open the cursor after declare, if the cursor is unbound (no cursor for XXX When declare is used), an anonymous cursor is obtained after the cursor is opened;
4. The cursor variable of the open operation is either declare or a string passed in as a parameter. In addition, an error is returned!