How to create function return table or cursor in oracle

Wednesday, July 26th, 2017 (0 Comment)

In this article, we research how to create a function return a table or a cursor in oracle.

We will have some way to do this.

Example: we have one table_a as below and one function return a table with ID >= 3

ID USERNAME NOTE
1 username_1 note a1
2 username_2 note a2
3 username_3 note a3
4 username_4 note a4
5 username_5 note a5

1) Create table and insert data for example cursor in oracle

2) Create object type and table type

3) Function return a table type or a cursor in oracle

3.1. Return a table type

Run

3.2. Return a cursor in oracle

Run

 

Tags: , ,

Related Posts

database
Create group user class by using object oriented plsql
database
Functions encrypt decrypt and checksum oracle
database
Create stored procedure pl/sql in oracle
database
Check tablespace usage percent in oracle

Related Posts

database
Create group user class by using object oriented plsql
database
Functions encrypt decrypt and checksum oracle
database
Create stored procedure pl/sql in oracle
database
Check tablespace usage percent in oracle

Leave a Reply

Your email address will not be published. Required fields are marked *