Create Report From Cursor [message #557962] |
Mon, 18 June 2012 05:22 |
snsiddiqui
Messages: 172 Registered: December 2008
|
Senior Member |
|
|
I want to create report against my below query, please suggest how?
Declare
Cursor Emp_Cur is
Select epi_id, epi_code
From emp_personal_info
Where epi_status = '73'
Order By epi_id ;
Cursor Atnd_Cur(epi_id varchar2) is
Select emp_data, eam_status
From emp_attnd_mast
Where eam_date between '01-JUN-2012' and '18-JUN-2012'
And eam_epi_id = epi_id
Order By eam_date ;
Val1 Number ;
Rec1 Emp_Cur%RowType;
Rec2 Atnd_Cur%RowType;
EmpNo emp_personal_info.epi_code%Type;
Begin
For Rec1 in Emp_Cur Loop
For Rec2 in Atnd_Cur(Rec1.epi_id) Loop
If Rec2.eam_status = '94' Then
Val1 := Val1 + 1;
If Nvl(Val1,0) > = 5 Then
dbms_output.put_line(Rec1.epi_code);
End If;
Else
Val1 := 0;
End If;
End Loop Rec2;
End Loop Rec1;
End;
|
|
|
|
Re: Create Report From Cursor [message #557970 is a reply to message #557967] |
Mon, 18 June 2012 06:37 |
snsiddiqui
Messages: 172 Registered: December 2008
|
Senior Member |
|
|
Thanks, Littlefoot
OK, I check the syntax for global temporary table.
Would you please also suggest me for the right query, actually I want to get continuous absent employees list against my given date range and number of days.
|
|
|
|