Swaminathan K
asked on
Cursor expressions need to suppress the statement 2 in the query output.
Hi Team ,
Iam using a cursor expression in my query . In the query output I need to exclude the CURSOR STATEMENT : 2 statement fron the output and show only the column values . Any help is really appreciated.
Executive CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
FIRST_NAME
--------------------
Steven
Neena
Lex
Finance CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
FIRST_NAME
--------------------
Nancy
Daniel
John%
Ismael
Jose Manuel
Luis
6 rows selected.
Query :
SELECT
d.department_name ,
cursor (select first_name from employees e where e.department_id=d.departme nt_id) employeeInfo
from departments d
Iam using a cursor expression in my query . In the query output I need to exclude the CURSOR STATEMENT : 2 statement fron the output and show only the column values . Any help is really appreciated.
Executive CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
FIRST_NAME
--------------------
Steven
Neena
Lex
Finance CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
FIRST_NAME
--------------------
Nancy
Daniel
John%
Ismael
Jose Manuel
Luis
6 rows selected.
Query :
SELECT
d.department_name ,
cursor (select first_name from employees e where e.department_id=d.departme
from departments d
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I want to Executive
Steven
Neena
Sales
Vinod
Gopal
Steven
Neena
Sales
Vinod
Gopal
If it's "pure" SQLPLUS, you may try this (adept to your needs/setup; I took the "old" HR schema):
set pages 0;
break on department_name skip 1;
select a.department_name,
b.first_name || ' ' || b.last_name ename
from hr.employees b,
hr.departments a
where b.department_id = a.department_id
order by a.department_name;
/
ASKER
thanka a lot
Open in new window
Open in new window