Updateable stored function

Perry

Member
Hi,

I succesfully used the example in this forum to use a stored function with a record type as return value.
But now I want that function to be updateable!
Is there a way I can do this?
My SQL in the TOracleDataset looks now like this:

declare
rec tb_analyse_component%rowtype;
begin
rec:=MICADO.DOMEIN_PACK.F_GETANALYSECOMPONENT(
tongue.gif
_AnalyseComponentID);
tongue.gif
_ID := rec.Analyse_Component_ID;
tongue.gif
_Naam := rec.Naam;
tongue.gif
_Omschrijving := rec.Omschrijving;
end;

Thanx in advance.
Perry van der Meeren
 
You can only base a TOracleDataSet on a program unit call that returns a result set. Therefore you would have to modify your PL/SQL Block like this:
Code:
declare
  rec tb_analyse_component%rowtype;
begin
  rec := MICADO.DOMEIN_PACK.F_GETANALYSECOMPONENT(:p_AnalyseComponentID);
  open :v_cursor for
    select rec.Analyse_Component_ID Analyse_Component_ID,
           rec.Naam Naam,
           rec.Omschrijving Omschrijving
      from dual;
end;
The :v_cursor variable is a Cursor variable. Now you have a read-only result set though. You will have to write an OnApplyRecord event handler to make it updateable, and to process the actual update. See the PkgApply demo project for a complete example.

------------------
Marco Kalter
Allround Automations
 
Back
Top