473,408 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

SQL0440N No authorized routine named error

Hi

I get the following error when running the following statement

SELECT R.ROW_NUMBER, random(1, 'Sk1', 1, 100, 1) AS INTEGER_R6_1_100 FROM RANDOM_NUMBERS R;


SQL0440N No authorized routine named "RANDOM" of type "FUNCTION" having
compatible arguments was found. SQLSTATE=42884

Here is the definition of the function RANDOM

Also does anyone know how I can run the debugger in development center when creating a user defined function. It seems when I go into edit mode to edit the function it disables the debugging UI.

CREATE FUNCTION DB15USER.random(v_source INTEGER, v_distribution CHAR(3), v_a DOUBLE, v_b DOUBLE, v_c DOUBLE) RETURNS
INTEGER

LANGUAGE SQL
--MODIFIES SQL DATA
CALLED ON NULL INPUT

BEGIN ATOMIC

DECLARE v_random INTEGER;
DECLARE v_s DOUBLE;
DECLARE v_source2 INTEGER;
DECLARE v_distribution2 CHAR(3);
DECLARE v_a2 DOUBLE;
DECLARE v_b2 DOUBLE;
DECLARE v_c2 DOUBLE;

Set v_source2 = v_source;
Set v_distribution2 = v_distribution;
Set v_a2 = v_a;
Set v_b2 = v_b;
Set v_c2 = v_c;

IF v_a2 IS NULL THEN
SET v_a2 = 0;
END IF;


IF v_b2 IS NULL THEN
SET v_b2 = 1;
END IF;

IF v_distribution2 IS NULL THEN
SET v_distribution2 = 'Uni';
END IF;

IF v_c2 IS NULL THEN
SET v_c2 = (v_a2 + v_b2) / 2;
END IF;

SET v_s = CAST (v_source2 AS DOUBLE) / 100000000;

IF v_distribution2 = 'Exp' THEN
IF (v_source2 = 0) THEN
SET v_source2 = 1;
END IF;

SET v_random = -1 * LN(v_s) * v_a2;
RETURN v_random;
END IF;

IF v_distribution2 = 'Nor' THEN
IF (v_s = 0) THEN
SET v_s = 1;
END IF;
SET v_random = SQRT(-2 * LN(v_s)) * SIN(2 * 3.14 * (CAST (v_c2 AS DOUBLE) / CAST (100000000 AS DOUBLE))) * v_b2 + v_a2;
RETURN v_random;
END IF;

IF v_distribution2 = 'Sk1' THEN
SET v_s = SQRT(v_s);
END IF;

IF v_distribution2 = 'Sk2' THEN
SET v_s =SQRT(v_s);
END IF;

IF (v_s < 0) THEN
SET v_s = 0;
END IF;

IF (v_s > 1) THEN
SET v_s = 0.99999999;
END IF;

SET v_random = v_s * (v_b2 - v_a2 + 1) + v_a2;



RETURN v_random;

END

Thanks
Oct 29 '07 #1
0 4320

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Roberto Dias | last post by:
I developed a DFT routine using a language named "ATP Model Language". It is based on FORTRAN and specific to electromagnetic transients simulations, a study field in electrical engineering. Few...
4
by: shalini | last post by:
All, we are trying to create and execute our stored procs on db2 ver 8.1 fp5. This is a new database that we setup and are having some trouble. When I try and run the stored proc from the db2...
0
by: Thiago Campos Pereira | last post by:
Hi, I am with the following problem. I have installed a IIS 6.0 / Windows 2003 and created a simple HTML Page (with a simple text, for test - Test.HTML). I am trying access the page with the IE...
2
by: dalvigirish | last post by:
Hi, I am new to DB2. I am trying to write a simple stored procedure, but getting the error attached below. ERROR ========================================================== TGT.AUDIT - Build...
5
by: Tony Girgenti | last post by:
Hello. I developed and tested a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form. Development testing works fine on my...
1
by: MenakaMeena | last post by:
Hi while trying to invoke the stored procedure in DB2 from java i get the following error in log. Can u plz help me? sql0440N. No authorized routine named "XXX" of type having compatible arguments...
7
by: Bob Darlington | last post by:
I'm using the following routine to call UpdateDiary() - below: Private Sub Form_BeforeUpdate(Cancel As Integer) On Error GoTo Form_BeforeUpdate_Error Call UpdateDiary(Me!TenantCounter,...
3
by: ssg31415926 | last post by:
I'm getting the error: "Unable to open the Web 'http://blah/blahblah'. You are not authorized to perform the current operation". I have changed a few things recently but I can't change them back...
2
by: whitsey | last post by:
Trying to concatenate two fields into one however I seem unable to do so. All I want is to execute the following SELECT MONTH(L.DATE) ||' '|| YEAR(L.DATE) as MTH_OF_YEAR FROM LOG L But I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.