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 -> newbie question: calling functions

newbie question: calling functions

From: please_remove <_at_inesca.pt(please_remove)>
Date: 1998/04/17
Message-ID: <6h7h1u$jl1$1@news.ua.pt>#1/1

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;

  END LOOP;
  nome:=pack_funcoes.compoe_nome(palavras,i);   RETURN(TRUE);
  EXCEPTION
    WHEN NO_DATA_FOUND THEN RETURN(FALSE); END; end pack_inesc; Received on Fri Apr 17 1998 - 00:00:00 CDT

Original text of this message

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