If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > pl/sql package will not compile

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-26-03, 03:36
osy45 osy45 is offline
Registered User
 
Join Date: Nov 2002
Posts: 833
pl/sql package will not compile

hi,

trying to concat 1:m relationsships data to a string fails :

what did I do wrong?



PACKAGE denorm_PKG IS


FUNCTION GetNetz (ix_knoten IN knoten.id_knoten%TYPE,
ix_plan IN knoten.id_plan%TYPE) RETURN VARCHAR2 ;


END denorm_PKG;
/
PACKAGE BODY denorm_PKG AS

/*

*/
FUNCTION GetNetz (ix_knoten IN knoten.id_knoten%TYPE,
ix_plan IN knoten.id_plan%TYPE) RETURN VARCHAR2

IS
-- Cursor für die Datenbankabfrage
CURSOR netzcrs (lv_netzwerkdienst n.netzwerkdienst%TYPE) IS

select n.netzwerkdienst

from netzwerkdienst n, knoten_netzwerkdienst kn

where n.id_netzwerkdienst = kn.id_netzwerkdienst

and kn.id_plan = ix_plan
and kn.id_knoten = ix_knoten;

tmpVar varchar2;
netz_rec netzcrs%ROWTYPE;
BEGIN
tmpVar := NULL;


IF NOT netzcrs%ISOPEN
THEN
OPEN netzcrs(lv_netzwerkdienst);
END IF;

FETCH netzcrs INTO netz_rec;
-- Schleife über alle Resultdatensätze, konkateniert alle
netzwerkdienste
WHILE (netzcrs%FOUND)
LOOP
IF tmpVar is NULL
THEN
tmpVar := netz_rec.lv_netzwerkdienst;
ELSE
tmpVar := tmpVar ||','|| netz_rec.lv_netzwerkdienst;

END IF;
FETCH netzcrs INTO netz_rec;
END LOOP;

CLOSE netzcrs;

RETURN tmpVar;
END GetNetz;



END denorm_PKG;
/

Oracle Version 8.1.7.4

error msges are the following

SP2-0734: Unbekannter Befehl ab "PACKAGE de..." - restliche Zeile
ignoriert.
SP2-0734: Unbekannter Befehl ab "FUNCTION G..." - restliche Zeile
ignoriert.
SP2-0734: Unbekannter Befehl ab "ix_plan IN..." - restliche Zeile
ignoriert.
SP2-0734: Unbekannter Befehl ab "END denorm..." - restliche Zeile
ignoriert.
SP2-0044: Zum Auflisten bekannter Befehle HELP
und zum Verlassen EXIT eingeben.
END denorm_PKG;
*
FEHLER in Zeile 32:
ORA-06550: line 32, column 1:
PLS-00103: Encountered the symbol "END"


SP2-0734: Unbekannter Befehl ab "PACKAGE BO..." - restliche Zeile
ignoriert.
DOC>
DOC>*/
SP2-0734: Unbekannter Befehl ab "FUNCTION G..." - restliche Zeile
ignoriert.
SP2-0734: Unbekannter Befehl ab "ix_plan IN..." - restliche Zeile
ignoriert.
SP2-0042: Unbekannter Befehl "IS" - restliche Zeile wurde ignoriert.
SP2-0734: Unbekannter Befehl ab "CURSOR net..." - restliche Zeile
ignoriert.
SP2-0734: Unbekannter Befehl ab "from netzw..." - restliche Zeile
ignoriert.
SP2-0734: Unbekannter Befehl ab "where n.id..." - restliche Zeile
ignoriert.
SP2-0734: Unbekannter Befehl ab "and kn.id_..." - restliche Zeile
ignoriert.
SP2-0734: Unbekannter Befehl ab "and kn.id_..." - restliche Zeile
ignoriert.
SP2-0044: Zum Auflisten bekannter Befehle HELP
und zum Verlassen EXIT eingeben.
SP2-0734: Unbekannter Befehl ab "tmpVar var..." - restliche Zeile
ignoriert.
SP2-0734: Unbekannter Befehl ab "netz_rec n..." - restliche Zeile
ignoriert.
END denorm_PKG;
*
FEHLER in Zeile 32:
ORA-06550: line 32, column 1:
PLS-00103: Encountered the symbol "END"


SQL> PACKAGE denorm_PKG IS


SP2-0734: Unbekannter Befehl ab "PACKAGE de..." - restliche Zeile
ignoriert.
SQL>
Reply With Quote
  #2 (permalink)  
Old 03-26-03, 04:39
alligatorsql.com alligatorsql.com is offline
Registered User
 
Join Date: Jul 2001
Location: Germany
Posts: 189
Question More infos

Hello,

which program do you use .... I never read such error statements !!!
As I was testing your posted package with AlligatorSQL, it compiles
with any error - except that I do not have your table "knoten".

Perhaps you have to place a "CREATE OR REPLACE" before your "PACKAGE BODY" and "PACKAGE" statement ?!!?

Hope that helps

Manfred Peter
(Alligator Company GmbH)
http://www.alligatorsql.com
Reply With Quote
  #3 (permalink)  
Old 03-26-03, 05:41
osy45 osy45 is offline
Registered User
 
Join Date: Nov 2002
Posts: 833
Re: More infos

Quote:
Originally posted by alligatorsql.com
Hello,

which program do you use .... I never read such error statements !!!
As I was testing your posted package with AlligatorSQL, it compiles
with any error - except that I do not have your table "knoten".

Perhaps you have to place a "CREATE OR REPLACE" before your "PACKAGE BODY" and "PACKAGE" statement ?!!?

Hope that helps

Manfred Peter
(Alligator Company GmbH)
http://www.alligatorsql.com
I 've used sqlplus and the stmts as a script.sql
Reply With Quote
  #4 (permalink)  
Old 03-26-03, 07:19
alligatorsql.com alligatorsql.com is offline
Registered User
 
Join Date: Jul 2001
Location: Germany
Posts: 189
CREATE OR REPLACE

Hello,

do you have tested the "CREATE OR REPLACE PACKAGE"
command ?

Just insert "CREATE OR REPLACE" before your package and package specification.

Best regards
Manfred Peter
(Alligator Company GmbH)
http://www.alligatorsql.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On