Hi,
I have a cursor with several designations as below,
cItem
ACCOUNT ASSISTANT
ASSISTENT OFFICE
In here if ACCOUNT ASSISTANT the results are ,
cFact nEmpNo cFullName
SGL 1 ABC Perera
SGL 2 XYZ Silva
SGL 3 DFG Perera
And if ASSISTENT OFFICE the results are,
cFact nEmpNo cFullName
SGL 4 Nikini
SGL 5 Hashen
SGL 6 Samekshi
And my final result should be like this,
cFact nEmpNo cFullName
SGL 1 ABC Perera
SGL 2 XYZ Silva
SGL 3 DFG Perera
SGL 4 Nikini
SGL 5 Hashen
SGL 6 Samekshi
For this I did something like this.
CREATE CURSOR Emp_Dtl(cFact C(5) Null,nEmpNo N(15,0) Null,cFullName C(100) Null,cDepartment C(50) Null,dJoin D Null,dResign D Null,Months int Null, Period c(100) Null)
SELECT Selecteditems
SCAN
stra = "SELECT cFact,nEmpNo,cFullName "
stra = stra + "from HRIS.dbo.vHRIS_Deletion where cDesignation = ?Selecteditems.cItem AND cResignCat = 'RESIGN' "
SQLEXEC(hndOps,stra,'Emp_Detl')
SELECT Emp_Dtl
replace cFact WITH Emp_Detl.cFact
replace nEmpNo WITH Emp_Detl.nEmpNo
replace cFullName WITH Emp_Detl.cFullName
ENDSCAN
From this I can't get any records. How can I get my final output as I mentioned above?
Thank you.
I have a cursor with several designations as below,
cItem
ACCOUNT ASSISTANT
ASSISTENT OFFICE
In here if ACCOUNT ASSISTANT the results are ,
cFact nEmpNo cFullName
SGL 1 ABC Perera
SGL 2 XYZ Silva
SGL 3 DFG Perera
And if ASSISTENT OFFICE the results are,
cFact nEmpNo cFullName
SGL 4 Nikini
SGL 5 Hashen
SGL 6 Samekshi
And my final result should be like this,
cFact nEmpNo cFullName
SGL 1 ABC Perera
SGL 2 XYZ Silva
SGL 3 DFG Perera
SGL 4 Nikini
SGL 5 Hashen
SGL 6 Samekshi
For this I did something like this.
CREATE CURSOR Emp_Dtl(cFact C(5) Null,nEmpNo N(15,0) Null,cFullName C(100) Null,cDepartment C(50) Null,dJoin D Null,dResign D Null,Months int Null, Period c(100) Null)
SELECT Selecteditems
SCAN
stra = "SELECT cFact,nEmpNo,cFullName "
stra = stra + "from HRIS.dbo.vHRIS_Deletion where cDesignation = ?Selecteditems.cItem AND cResignCat = 'RESIGN' "
SQLEXEC(hndOps,stra,'Emp_Detl')
SELECT Emp_Dtl
replace cFact WITH Emp_Detl.cFact
replace nEmpNo WITH Emp_Detl.nEmpNo
replace cFullName WITH Emp_Detl.cFullName
ENDSCAN
From this I can't get any records. How can I get my final output as I mentioned above?
Thank you.