Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> newbie question: calling functions
Hi.
I want to re-use an already existent function 'xconcatn'. The problem is
that this function, can't be used as a query column, since it has IN/OUT
parms. So I tried to write function 'formar_nome' to use it like this:
SELECT PACK_INESC.formar_nome( 8) FROM dual;
I'm sure it's easy to construct function 'formar_nome' to use the functionality already implemented in 'xconcatn'. I tried, but I get compilation errors.
(a) how can I see the compilation errors? Does the compiler generates
messages explaining the error? (I just get: package created with errors)
(b) looking to the code below, what's wrong about the highlighted line
(the one which causes the error)? Datatypes? Why?
Thanks in advance.
Ilidio Oliveira
CREATE PACKAGE BODY PACK_INESC AS
FUNCTION formar_nome (
numero in NUMBER
) RETURN varchar2
IS
nome VARCHAR2(100);
b BOOLEAN;
begin
nome := 'hello world';
return( nome );
end;
FUNCTION xconcatn (
numero in NUMBER,
nome in out VARCHAR2 ) RETURN BOOLEAN
IS
palavras pack_funcoes.ARRNOMES;
i INTEGER := 0;
BEGIN
FOR key in (SELECT numord FROM ide_ocorrencias
WHERE num_sequencial=numero ORDER BY ordem) LOOP SELECT nome INTO palavras(i) FROM ide_nomes WHERE numord=key.numord; i:=i+1;
![]() |
![]() |