ref cursor and 'where current of' problem

From: Stefan Röhle <roehle_at_uni-mainz.de>
Date: Tue, 21 May 2002 11:56:06 +0200
Message-ID: <3CEA19B6.41472DAC_at_uni-mainz.de>



Hi,

thanks for the previous help. Now the dynamic where clause is implemented but now I have a new problem: I want to update certain lines of the cursor where some condition is fulfilled, but I can't refer to the ref cursor with the usual 'where current of'. What can I do to get this work?

[Example of problem]



PROCEDURE diff_test (where_clause in varchar2 := 'vw_kommentar = ''Sammel1''') IS

type vw_curtype is ref cursor;
vw_curvar vw_curtype;
vw_temp vw_data%ROWTYPE;

BEGIN open vw_curvar for 'select * from vw_data where '||nvl(where_clause,'1=1')||' for update'; loop
fetch vw_curvar into vw_temp;
exit when vw_curvar%NOTFOUND;

update vw_data
set compare = 'update-test'
where current of vw_curvar; -- <=== THIS DOES NOT WORK, I GET A PLS-00413 end loop;
close vw_curvar;

END;


Stefan Received on Tue May 21 2002 - 11:56:06 CEST

Original text of this message