How can a function retun more than one value in oracle with proper example?
Answer / Shalini Pathak
In Oracle PL/SQL, a function cannot return multiple values directly. However, you can use collections (such as arrays or tables) to return multiple values. Here's an example of a table-valued function that returns a table of employee names:
CREATE OR REPLACE TYPE employees_table AS TABLE OF VARCHAR2(30);
CREATE OR REPLACE FUNCTION get_employees RETURN employees_table IS
v_employees employees_table;
BEGIN
SELECT employee_name BULK COLLECT INTO v_employees FROM employees;
RETURN v_employees;
END;
| Is This Answer Correct ? | 0 Yes | 0 No |
Authentication mechanisms in Sql Server ?
How do you take the union of two tables in sql?
What are some emotional triggers?
Does varchar need length?
How do you optimize a query?
hi sql gurus, here is my question 4 u. i wanna use triggers for sending reminder mail to all users who are registered to the site. if any one knws the code plz send me ans here : chayabs3@gmail.com thnx advance
What is the difference between clustered and non-clustered index in sql?
how can I make a script that can be bi-language (supports english, german)? : Sql dba
What are the dml statements?
How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?
How to make a copy values from one column to another in sql?
What is string data type in sql?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)