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

Home -> Community -> Usenet -> c.d.o.server -> INSERT in PL/SQL function

INSERT in PL/SQL function

From: Susanne Heymann <susanne_at_metronet.de>
Date: 1997/07/30
Message-ID: <Pine.GSO.3.94.970730164857.23297A-100000@titiwu.zentrale.metronet.de>#1/1

Hi all,

I'm trying to find a way to insert or update table data within a function. Background: The functions are to be called from another application that needs a return code to verify that the function worked.

I've tried cheating Oracle by encapsulating the insert statement in a procedure or hiding it behind dbms_sql but Oracle still tells me that the function violates its pragma.

How can I work around it?

Again: what I want to do is the following: create or replace function foo (in_data in whatever) return number is begin

    if (checks on in_data return TRUE) then
=09insert into table values(in_data);
=09return 1;

    else
=09return 0;

    end if;
when others then
=09return 0;

end;

The calling applcation should be able to do something like $return_code =3D (SELECT foo($data) from dual; and $return_code would then be either 1 or 0

Thanks,
=09Susanne =09


Susanne Heymann                         phone: (+49) (0)221 3091 251
metronet GmbH                             fax: (+49) (0)221 3091 298
Bonner Str. 172-176                      e-mail: susanne_at_metronet.de
D-50968 K=F6ln-Bayenthal          www: http://www.metronet.de/~susanne
--------------------------------------------------------------------
New address and phone!                                    -- Susanne
--------------------------------------------------------------------
Received on Wed Jul 30 1997 - 00:00:00 CDT

Original text of this message

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