Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / tina

create a function


--concat column values

create or replace function conactfunc (query_1 in varchar2)
return varchar2
is
v_return varchar2(4000);
v_query_concat varchar2(4000);
cur sys_refcursor;
begin
open cur for query_1;

loop
fetch cur into v_query_concat;
EXIT WHEN cur%NOTFOUND;
if v_return is null then
v_return := v_query_concat;
else
v_return := v_return || '@' || v_query_concat;
end if;
end loop;
return v_return;
end;


show_err;

and then call it


select hr.conactfunc('select region_name from regions') from dual;

O/P

Europe@Americas@Asia@Middle East and Africa

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is execute immediate?

1084


Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.

1012


What is not equal in sql?

1123


what is a table called, if it has neither cluster nor non-cluster index? What is it used for? : Sql dba

975


What are the basic techniques of indexing?

1061


Write a sql query to find the names of employees that begin with ‘a’?

1015


When is the explicit cursor used ?

1034


What is a full join sql?

1056


What is out parameter used for eventhough return statement can also be used in pl/sql?

1077


Which nosql database is best?

975


What is a null value?

1143


what is a control file ? : Sql dba

1039


Is merge a dml statement?

979


How many postgresql users are there, worldwide?

1061


Can dml statements be used in pl/sql?

1080