Hello again,
I'm also using Cursors like example below and I can't figure it out how can I collapse whole code (which have "-" in front using command Fold All
so Cursor itself won't collapse but only code inside?
I would at least expect that when I click "+" in front code Cursor( I would see collapsed code inside that cursor but it isn't. It's all unfolded, ie. is not recursed to sublevels, only at top level. So if I wan't to see my whole code with more then e.g 1.000 lines inside main cursor I have to do that manually by clicking "-" in front of each sub Cursor.
Is this by design, is it a bug, or I don't know yet how to do it? I would need this too inside cursors (sub levels).
If you paste below code and use right mouse button and select "Fold All":
Select
E.EmpNo EmployeeNr,
( -- EmployeeJob
Case
When E.Job = 'CLERK'
Then 'Clerk'
Else
E.Job
End
) EmployeeJob,
( -- EmployeeName
InitCap(E.EName)
) EmployeeName,
E.DeptNo EmployeeDept
From
SCOTT.EMP E
;
-- Cursor Employees
-- How to collapse only code inside cursor like above, but not also cursor itself?
Select
'file1' As "filename",
Cursor(
Select
Cursor( -- Employees (rec_emp)
Select
E.EmpNo EmployeeNr,
( -- EmployeeJob
Case
When E.Job = 'CLERK'
Then 'Clerk'
Else
E.Job
End
) EmployeeJob,
( -- EmployeeName
InitCap(E.EName)
) EmployeeName,
E.DeptNo EmployeeDept
From
SCOTT.EMP E
) "rec_emp"
From
Dual
) "data"
From
Dual
;
I got this:
Select
E.EmpNo EmployeeNr,
( -- EmployeeJob
( -- EmployeeName
E.DeptNo EmployeeDept
From
SCOTT.EMP E
;
-- Cursor Employees
Select
'file1' As "filename",
Cursor(
From
Dual
;
But I would need this (or at least when I click "+" in front Cursor and then Cursor( -- Employees (rec_emp)):
-- Cursor Employees
Select
'file1' As "filename",
Cursor(
Select
Cursor( -- Employees (rec_emp)
Select
E.EmpNo EmployeeNr,
( -- EmployeeJob
( -- EmployeeName
E.DeptNo EmployeeDept
From
SCOTT.EMP E
) "rec_emp"
From
Dual
;
Regards,
Blacksmith