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 28 October 2002, 04:52 PM
  #1  
V5
Scooby Regular
Thread Starter
 
V5's Avatar
 
Join Date: Jul 2002
Posts: 1,933
Likes: 0
Received 0 Likes on 0 Posts
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]
Old 28 October 2002, 05:56 PM
  #2  
towzer
Scooby Regular
 
towzer's Avatar
 
Join Date: Jun 2002
Posts: 547
Likes: 0
Received 0 Likes on 0 Posts
Post

Ian,

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

Phil
Old 29 October 2002, 08:11 AM
  #3  
V5
Scooby Regular
Thread Starter
 
V5's Avatar
 
Join Date: Jul 2002
Posts: 1,933
Likes: 0
Received 0 Likes on 0 Posts
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!!
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Sam Witwicky
Engine Management and ECU Remapping
17
13 November 2015 10:49 AM
Nick_Cat
Computer & Technology Related
2
26 September 2015 08:00 AM
DazV
Non Scooby Related
4
19 August 2001 05:15 PM
stan
Non Scooby Related
5
20 September 2000 02:07 PM



Quick Reply: Help - Oracle Errors and Pragmas



All times are GMT +1. The time now is 07:14 PM.