ename empno deptno
amar 1 10
akbar 2 20
anthonny 3 30
jonathan 4 40

write a procedure to dispaly the column values ina row
separated by a
deleimiter
eg - input - select ename from emp '|' output -
amar|akbar|anthony|jonathan
input - select empno from emp '@' o/p - 1@2@3@4
input - select deptno from emp '/' o/p -
10/20/30/40

Pls answer this questn.

Answer Posted / sujatha nulu

Hi,
We have well advanced concepts in Oracle to achieve this.
LISTAGG analytical function can be used for this.

If its ename to be concatenated yet separated by delimiter,
use this way;

SELECT LISTAGG(ename,'|')
WITH IN GROUP (ORDER BY DEPTNO)
FROM EMPLOYEES
GROUP BY DEPTNO
ORDER BY DEPTNO;

You can write a procedure and pass column, delimiter as
parameters.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is PL/SQL Records?

628


Explain alias in sql?

582


What is the unique index?

525


What is a natural join?

515


Can we create table in function?

569






How many sql databases can you have on one server?

594


What is your daily office routine?

1810


What is raid? How does it help storage of databases?

601


What is the reports view in oracle sql developer?

540


how to create a new view in mysql? : Sql dba

495


Why function is used in sql?

521


How delete a row in sql?

534


what is cross join? : Sql dba

572


Does oracle use sql?

512


How many postgresql users are there, worldwide?

579