Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Writing user defined function the same way as the oracle functions

Rajan SwSep 26 2012 — edited Sep 26 2012
Hi Guys,

In one of the interviews , I have attended the guy asked me to write a user defined function which will take the column name and list all the values .

For example

Table Name:Employees
Column Name: Employee_Name

Employee_name
Scott
Ivgun
Jack
Shane

The query should be in this fromat

SELECT col_agg(Employee_name) emp_name from Employees;

The output shoulld be

Emp_names
scott,ivgun,jack,shane

Please let me know if this is possible


Any suggestions will be highly appreciated.

Thanks,
Ranjan
This post has been answered by BluShadow on Sep 26 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2012
Added on Sep 26 2012
6 comments
444 views