Good suggestion...

About the only problem is that if I try to select on the package.function
name, I
get an error stating that I'm not allowed to perform DML on a select
statement.

Ad the problem with declaring a variable such as:

declare x number; begin x := raknaupp.fakturanummer; end;

Well, the application (written in FoxPro) that tries to use the statement
goes
gaga on it and doesn't recieve a value from the statement apart from the
fact
that the SQL-statement succeded..

This is giving me grey(er) hair! :)

Oh well, thanks for the suggestions guys... I think I have to rethink the
entire thing :)

/Stefan

> -----Ursprungligt meddelande-----
> Från: Mercadante, Thomas F 
> [mailto:[EMAIL PROTECTED]]
> Skickat: den 13 februari 2002 15:58
> Till: Multiple recipients of list ORACLE-L
> Ämne: RE: Ok... this is driving me nuts!
> 
> 
> Stefan,
> 
> You cannot execute functions in that manner.
> 
> You can however, do :
> 
> select RAKNAUPP.FAKTURANUMMER from dual;
> 
> The problem is that the function is trying to return a value 
> to you.  When
> you try and CALL it, there is no place for the value to return to.
> 
> Hope this helps
> 
> Tom Mercadante
> Oracle Certified Professional
> 
> 
> -----Original Message-----
> Sent: Wednesday, February 13, 2002 9:23 AM
> To: Multiple recipients of list ORACLE-L
> 
> 
> 
> I have the following package defined....
> 
> PACKAGE         RAKNAUPP AS
> FUNCTION FAKTURANUMMER RETURN NUMBER;
> FUNCTION MEDLEMSNUMMER RETURN NUMBER;
> FUNCTION OCRNUMMER RETURN NUMBER;
> FUNCTION INBETNUMMER RETURN NUMBER;
> END RAKNAUPP;
> 
> PACKAGE BODY         RAKNAUPP AS
> FUNCTION FAKTURANUMMER
> RETURN NUMBER
> IS NFAKNR NUMBER(8);
> BEGIN
>       SELECT medlfaktnr+1 INTO NFAKNR FROM parametrar FOR UPDATE;
>       UPDATE parametrar SET medlfaktnr = medlfaktnr+1;
>       COMMIT;
>       RETURN (NFAKNR);
> END FAKTURANUMMER;
> FUNCTION OCRNUMMER
> RETURN NUMBER
> IS NOCRNR NUMBER(6);
> BEGIN
>       SELECT ocrnr+1 INTO NOCRNR FROM parametrar FOR UPDATE;
>       UPDATE parametrar SET ocrnr = ocrnr+1;
>       COMMIT;
>       RETURN (NOCRNR);
> END OCRNUMMER;
> FUNCTION MEDLEMSNUMMER
> RETURN NUMBER
> IS NMEDNR NUMBER(6);
> BEGIN
>       SELECT medlnr+1 INTO NMEDNR FROM parametrar FOR UPDATE;
>       UPDATE parametrar SET medlnr = medlnr+1;
>       COMMIT;
>       RETURN (NMEDNR);
> END MEDLEMSNUMMER;
> FUNCTION INBETNUMMER
> RETURN NUMBER
> IS NINBNR NUMBER(6);
> BEGIN
>       SELECT inbetnr+1 INTO NINBNR FROM parametrar FOR UPDATE;
>       UPDATE parametrar SET inbetnr = inbetnr+1;
>       COMMIT;
>       RETURN (NINBNR);
> END INBETNUMMER;
> END RAKNAUPP;
> 
> It works fine, except when I try to run it with call:
> 
> call RAKNAUPP.FAKTURANUMMER;
> 
> Then I get:
> 
> ORA-06576: not a valid function or procedure name
> call <ERROR>'raknaupp.fakturanummer'
> 
> And I'm about at my wits end here... I can't for my life 
> figure out why this
> isn't working as it is suposed to!
> 
> Could someone please figure out what I am doing wrong?????????
> 
> Stefan Jakobsson
> [EMAIL PROTECTED]
> Telefon: 08-470 24 00
> Telefax: 08-470 24 24
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> -- 
> Author: Stefan Jakobsson
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
> San Diego, California        -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> -- 
> Author: Mercadante, Thomas F
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
> San Diego, California        -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
> 
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Stefan Jakobsson
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to