• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Pragma Restrict References giving problems...

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everybody..
I have a oracle package that runs perfectly on oracle 9i but gives some errors on an Oracle 7.3.2 Enterprise Edition on a Sco Unix
machine. This is concerning the pragma that has been declared. It
basically says that the function voilates it's pragma..


Some sites mention that previous to Oracle 8i usage of DBMS_PIPE is very
dicy... and that the usage of RAISE_APPLICATION_ERROR is problematic . I
tried commenting out that part but the error still persisted..


The package is as follows :

------------------------------------------------------------------------------

CREATE OR REPLACE PACKAGE Tools AS
FUNCTION Convert(data VARCHAR2,command VARCHAR2,timeout NUMBER DEFAULT
10)
RETURN VARCHAR;

PRAGMA RESTRICT_REFERENCES(Tools,WNDS,RNDS);

PROCEDURE Stop(timeout NUMBER DEFAULT 10);
END Tools;
/
CREATE OR REPLACE PACKAGE BODY Tools AS
FUNCTION Convert(data VARCHAR2,command VARCHAR2,timeout NUMBER DEFAULT 10)
RETURN VARCHAR IS
status NUMBER;
result VARCHAR2(2048);
resultStr VARCHAR2(4128);
pipe_name VARCHAR2(32);
lengthdata NUMBER;
lengthcommand NUMBER;
BEGIN

pipe_name := DBMS_PIPE.UNIQUE_SESSION_NAME;


IF data is NULL THEN
RAISE_APPLICATION_ERROR(-20010,'Input data should not be NULL.');
END IF;

IF command is NULL THEN
RAISE_APPLICATION_ERROR(-20011,'Conversion option (ENG2ISCII or
ISCII2ENG) should not be NULL.');
END IF;

IF UPPER(command) <>'ENG2ISCII' and UPPER(command) <>'ISCII2ENG' THEN
RAISE_APPLICATION_ERROR(-20012,'Conversion option should be ENG2ISCII or
ISCII2ENG.');
END IF;


DBMS_PIPE.PACK_MESSAGE('TRANSLITRATE');
DBMS_PIPE.PACK_MESSAGE(pipe_name);
DBMS_PIPE.PACK_MESSAGE(data);
DBMS_PIPE.PACK_MESSAGE(command);

status := DBMS_PIPE.SEND_MESSAGE('GistOra7ToolsNTR', timeout);

IF status <> 0 THEN
RAISE_APPLICATION_ERROR(-20050,'Gist_PLSNTranslate: Error while
sending. Status = ' ||status);
END IF;

status := DBMS_PIPE.RECEIVE_MESSAGE(pipe_name, timeout);



DBMS_PIPE.UNPACK_MESSAGE(result);


IF result <> 'done' THEN
RAISE_APPLICATION_ERROR(-20051,'Gist_PLSNTranslate: Error while
receiving. Status = ' ||status);
ELSE
DBMS_PIPE.UNPACK_MESSAGE(resultStr);

END IF;
RETURN resultStr;

END Convert;

PROCEDURE Stop(timeout NUMBER DEFAULT 10) IS
status NUMBER;
uname VARCHAR2(32);
BEGIN

IF uname <> 'sys' THEN
RAISE_APPLICATION_ERROR(-20052,'Insufficient Rights.');
ELSE
DBMS_PIPE.PACK_MESSAGE('STOP');
status := DBMS_PIPE.SEND_MESSAGE('GistOra7ToolsNTR', timeout);
IF status <> 0 THEN
RAISE_APPLICATION_ERROR(-20040,
'Stop: Error while sending. Status = ' || status);
END IF;

END IF;

END Stop;
END Tools;
/
COMMIT
/
grant all on Tools to public;

/



-------------------------------------------------------------------------------
Any help would be useful

[ June 29, 2005: Message edited by: gov kur ]
[ June 29, 2005: Message edited by: gov kur ]
 
gov kur
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
come on people ..please respond .... i need to know if i am heading into a brick wall eg. or there is some solution

Please help
 
author & internet detective
Posts: 42003
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While waiting for a response, it would be helpful to try to narrow down the problem. See what parts of the stored proc you can delete while still having the problem occur. This minimal stored proc will give us more to work with and may even help you find the solution.
 
gov kur
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replying Jeanne ..
yeah i already did that ..and this is the minimal amount that still does not work ...

---------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE New AS

FUNCTION Gist(timeout NUMBER DEFAULT 10)

RETURN VARCHAR;

PRAGMA RESTRICT_REFERENCES(Gist,WNDS,RNDS);


END New;

/



CREATE OR REPLACE PACKAGE BODY New AS

FUNCTION Gist(timeout NUMBER DEFAULT 10)

RETURN VARCHAR IS

status NUMBER;

pipe_name VARCHAR2(32);

result VARCHAR2(2048);

BEGIN



pipe_name := DBMS_PIPE.UNIQUE_SESSION_NAME;



DBMS_PIPE.PACK_MESSAGE('Sending from package');

DBMS_PIPE.PACK_MESSAGE(pipe_name);



status := DBMS_PIPE.SEND_MESSAGE('GistOra7ToolsNTR', timeout);



status := DBMS_PIPE.RECEIVE_MESSAGE(pipe_name, timeout);



DBMS_PIPE.UNPACK_MESSAGE(result);



return result;



END Gist;





END New;

/

COMMIT

/



-----------------------------------------------------------------------------
i tried experimenting with the various purity levels but still no luck
Am i missing something obvious??
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gov,
As you obviously are aware, there is a vast difference between Oracle 9i and Oracle 7.3.2 -- not to mention the fact that Oracle 7.3.2 has been de-supported for many years now. That's probably why you aren't being inundated with a plethora of replies -- so I would suggest that you lower your expectations of getting an answer in this forum.

Have you tried the Oracle forums? See the following Web sites:

http://otn.oracle.com

http://metalink.oracle.com

http://asktom.oracle.com

Please excuse me for stating the obvious, but I think you should seriously consider upgrading -- especially if (as it seems from your post) you are trying to add new features to this system.

Good Luck,
Avi.
 
gov kur
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the links avi ...
and just for the record it's not my system .... it's some feature that a client wants.Personally i would dearly love to work on 9i and better ...but thats not my call is it ..?

gov
[ July 04, 2005: Message edited by: gov kur ]
 
Yup, yup, yup. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic