Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> problem with function which returning cursor

problem with function which returning cursor

From: Sadys <p.sadowsk_at_wp.pl>
Date: Thu, 5 Jan 2006 22:32:40 +0100
Message-ID: <dpk38t$9mj$1@atlantis.news.tpi.pl>


I have a problem with a function:

function getOrder (in numberOfOrders) return refCursor (
select sequence.nextval into tag; -- we get number value from sequence

update aaa -- we update older than sysdate rows from table using tag value set field=id
where realization_date<sysdate
and rownum<=numberOfOrder;

open outCursor for -- we get updated rows from aaa table into cursor select aaa.*,

          bbb.id
from aaa,

        bbb
where aaa.id=bbb.id

    and aaa.field=tag;

return outCursor;
);

This function dosen't return any rows, althought there are rows with realization_date lower than sysdate and for sure join aaa.id and bbb.id takes place - where could be the problem? Before execut a function I start transaction and after execut function transaction is closed.
Database server dosent throw any exception. From my point of view it looks as if the update clause or return cursor dosen't work...

Thanks in advance,

Paul. Received on Thu Jan 05 2006 - 15:32:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US