Re: Can't call Stored Function
From: Lun Wing San (Oracle) <"Lun>
Date: 1996/12/15
Message-ID: <32B4427A.4D83_at_qrcsun.qrc.org>#1/1
Date: 1996/12/15
Message-ID: <32B4427A.4D83_at_qrcsun.qrc.org>#1/1
J. Sultan wrote:
>
> So here is the next problem I ran into while working with a Oracle 7 DB:
> I've created a Stored Function to insert data into some tables.
> But when I try to execute this function which returns an integer:
> SELECT Funcname(a,b,c,d) Result FROM Dual
>
> Oracle tells me "Wrong Datatype"
> When I change the function into a stored procedure evrything works fine.
> What am I doing wrong?
There are several restrictions in using the user-defined function within your SQL statement. Please check:
- The stored function cannot take the whole column of data for processing. It must process row by row.
- The return datatype must be Oracle internal datatype, not the datatype of PL/SQL.
- The parameter mode must be IN.
- The parameter datatype must be Oracle inernal datatype, not the datatype of PL/SQL.
- It cannot involve the INSERT, UPDATE or DELETE inside the function.
- It cannot read or modify the package variables remotely or in parallel.
--- Name : Lun Wing San Title : Oracle Application Developer of Hong Kong Productivity Council Oracle Database Administrator and System Administrator of QRC Phone : (852)27885841Received on Sun Dec 15 1996 - 00:00:00 CET