How can we combine the output of 2 cursors? + oracle
Thanks n Advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ArulrajPosted Nov 2, 2009, 2:13 AM
ALTER TYPE SAMPLE_TYPE AS OBJECT ( COL1
NUMBER(6, 0), COL2 VARCHAR2(30));
CREATE TYPE SAMPLE_TABLETYPE AS
TABLE OF SAMPLE_TYPE;
(
p_restcode IN REST_INFO.REST_CODE%type,
p_attdt IN DAILYATTENDANCELOG.CHECKTIME%type
)
RETURN SAMPLE_TABLETYPE PIPELINED AS
r_mstabletype SAMPLE_TYPE;
BEGIN
FOR r_count IN (SELECT A.ID,A.NAME,B.ADDRESS,B.CITY FROM TABLE1 A,TABLE 2 B WHERE A.ID=B.ID) LOOP
r_mstabletype:=DAILYATTCOL(r_count.ID,r_count.NAME);
PIPE ROW(r_mstabletype);
END LOOP;
RETURN;
END ;