Updating multiple rows in pl sql Age related flirting dating behaviors and promiscuity

The ref cursor can be assigned to other ref cursor variables.

The ref cursor variable is not a cursor, but a variable that points to a cursor.SQL declare 2 type auth_cursor is ref cursor; 3 c1 auth_cursor; 4 r_c1 c1%rowtype; 5 begin 6 null; 7 end; 8 / r_c1 c1%rowtype; * ERROR at line 4: ORA-06550: line 4, column 8: PLS-00320: the declaration of the type of this expression is incomplete or malformed ORA-06550: line 4, column 8: PL/SQL: Item ignored However, a strongly typed cursor can use the cursor variable to define the cursor record.SQL declare 2 type auth_cursor is ref cursor return author%rowtype; 3 c1 auth_cursor; 4 r_c1 c1%rowtype; 5 begin 6 null; 7 end; 8 / In this example, the auth_cursor type returns an author%rowtype.By changing the definition of the cursor type to a strongly typed definition, the compiler will catch this error when the code is compiled.SQL declare 2 type auth_cursor is ref cursor 3 return book%rowtype; 4 c1 auth_cursor; 5 r_c1 author%rowtype; 6 begin 7 open c1 for select * from book; 8 fetch c1 into r_c1; 9 close c1; 10 end; 11 / fetch c1 into r_c1; * ERROR at line 8: ORA-06550: line 8, column 5: PLS-00394: wrong number of values in the INTO list of a FETCH statement ORA-06550: line 8, column 5: PL/SQL: SQL Statement ignored Now the compiler catches the error.There are two types of cursor variables: Strong REF Cursor and Weak REF Cursor What is the difference between Cursor and REF Cursor, and when would you appropriately use each of these?

880

Leave a Reply