how to fetch values in more than one row [message #198662] |
Wed, 18 October 2006 02:52 |
qewani
Messages: 51 Registered: December 2005 Location: uaq
|
Member |
|
|
hi
can any one tell me how to post values in the fields of tabular form which displays more than one record for each field??
i have tried the post change with loop but it only return one row.
i have a field where user insert the employee code (here i have a post change trigger)
post change trigger code is
declare
cursor kk is
select EMPD_DOCU_CODE,EMPD_NUMBER,EMPD_ISS_PLACE,
EMPD_ISS_DT,EMPD_EXP_DT,EMPD_INIT_DAYS,EMPD_JS_DATE,EMPD_JS_REMARKS
from PM_EMP_DOCUMENT
where EMPD_CODE = :EDH_EMP_CODE ;
begin
IF kk%ISOPEN THEN
CLOSE kk;
END IF;
OPEN kk ;
Loop
FETCH kk INTO :EDD_DOCU_CODE,:EDD_NUMBER,:EDD_ISS_PLACE,:EDD_ISS_DT,
:EDD_EXP_DT,:EDD_INIT_DAYS,:EDD_JS_DATE,:EDD_JS_REMARKS;
Exit when kk%notfound;
end loop;
close kk;
END;
while user inters the employee code it should shows the employee document details.
and there are more than one document details for each employee.
and my code currently shows only one row of the employee details.
how to make it show all the document details of the employee??
|
|
|
|
Re: how to fetch values in more than one row [message #198675 is a reply to message #198662] |
Wed, 18 October 2006 04:02 |
shahidmughal
Messages: 91 Registered: January 2006 Location: Faisalabad Pakistan
|
Member |
|
|
hi
to solve your problem
read this trigger i have make an addition
next_record;
----------------------------------------
declare
cursor kk is
select EMPD_DOCU_CODE,EMPD_NUMBER,EMPD_ISS_PLACE,
EMPD_ISS_DT,EMPD_EXP_DT,EMPD_INIT_DAYS,EMPD_JS_DATE,EMPD_JS_REMARKS
from PM_EMP_DOCUMENT
where EMPD_CODE = :EDH_EMP_CODE ;
begin
IF kk%ISOPEN THEN
CLOSE kk;
END IF;
OPEN kk ;
Loop
FETCH kk INTO :EDD_DOCU_CODE,:EDD_NUMBER,:EDD_ISS_PLACE,:EDD_ISS_DT,
:EDD_EXP_DT,:EDD_INIT_DAYS,:EDD_JS_DATE,:EDD_JS_REMARKS;
Exit when kk%notfound;
next_record;
end loop;
close kk;
END;
this will put your data in rows not in single row
regards
Muhammad Shahid Mughal
|
|
|
|
|
|
|