In the previous tutorial we learnt how to fetch data of different datatypes from different columns using the strong ref cursor. The strong ref cursors have a limitation that they have fixed return type which can only be a record datatype. However fixed return type makes a strong ref cursor less error prone in the application development. But this definitely requires an extra step of creating a user defined record datatype.
So, don’t we have any alternative way of fetching data of different datatype using ref cursor which doesn’t required the creation of user defined record datatype? Can’t we create a ref cursor which doesn’t have a fixed return type? Let’s find out the answers of these questions in this blog.
I guess now you have got the answers to the above questions. PL/SQL Weak Ref Cursor is the alternative way of fetching data of different datatypes. As weak ref cursor doesn’t have a fixed return type thus there is no need of creating a separate record datatype. Now that we have cleared all our doubts it’s time to see an example which will help you in learning how to create PL/SQL weak ref cursors in Oracle Database.
That is the tutorial on how to create PL/SQL weak ref cursor in Oracle Database. So make sure to subscribe to the YouTube channel. In the coming tutorial we will learn what is Sys Ref Cursor in Oracle Database. Thanks and have a great day!
You can DOWNLOAD SQL script and presentation used in the Video and in this article.