Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Help - Oracle Errors and Pragmas

Thread Tools
 
Search this Thread
 
Old Oct 28, 2002 | 04:52 PM
  #1  
V5's Avatar
V5
Thread Starter
Scooby Regular
 
Joined: Jul 2002
Posts: 1,933
Likes: 0
Angry

Annoyed now! I need to calculate the difference between two numbers and output a value based on the result in a select statement. This is on Oracle 7.3.2.3.0 (yes, I know it's old...!!!) so I can't use CASE. I'm trying to do it as a function in a pre-existing package:

Spec:

Code:
FUNCTION compare_numbers (
	  p_qty1   IN  NUMBER,
	  p_qty2   IN  NUMBER)
	  RETURN NUMBER;
	  PRAGMA RESTRICT_REFERENCES (compare_numbers, WNDS);
Body

Code:
FUNCTION compare_numbers (p_qty1 NUMBER, p_qty2 NUMBER)
    RETURN NUMBER
IS
BEGIN	
	IF p_qty1 > p_qty2
	THEN 
	  RETURN 0;
	ELSE
	  RETURN 3;
	END IF;
EXCEPTION
	WHEN OTHERS
	THEN
		err.application_error('jmc_upld', 'compare_numbers');
		RETURN NULL;
END compare_numbers;
The error I get is: PLS-00452: Subprogram 'COMPARE_NUMBERS' violates its associated pragma.

Tried looking on Metalink with no joy

I've no doubt done something stupid, so can someone point it out please!

Ta!
Iain


[Edited by V5 - 10/28/2002 4:58:49 PM]
Reply
Old Oct 28, 2002 | 05:56 PM
  #2  
towzer's Avatar
towzer
Scooby Regular
 
Joined: Jun 2002
Posts: 547
Likes: 0
Post

Ian,

My best mate works as a developer at Oracle, I have forwarded on your question incase it makes sense to him.

Phil
Reply
Old Oct 29, 2002 | 08:11 AM
  #3  
V5's Avatar
V5
Thread Starter
Scooby Regular
 
Joined: Jul 2002
Posts: 1,933
Likes: 0
Thumbs down

Cheers Towzer, but I've relalised (ok, well, a colleague has ) what the problem is. The exception writes to our debug table....and this is supposed to be a bit of code that doesn't update the database. D'oh!!
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Sam Witwicky
Engine Management and ECU Remapping
17
Nov 13, 2015 10:49 AM
Nick_Cat
Computer & Technology Related
2
Sep 26, 2015 08:00 AM
DazV
Non Scooby Related
4
Aug 19, 2001 05:15 PM
stan
Non Scooby Related
5
Sep 20, 2000 02:07 PM




All times are GMT +1. The time now is 09:17 AM.