473,549 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

registering a function in discoverer

151 New Member
Hi All,

I have a function that return some static value, based on the grade of a person. It takes the person id as the input.

This is my code
Expand|Select|Wrap|Line Numbers
  1. create or replace function fnc_get_employee_emoluments (person_id number) return NUMBER as
  2.     employee_grade varchar2(30);
  3.     first_position number; -- first occurrence of '.' in the grade
  4.     last_position number; -- second occurrence of '.' in the grade 
  5.     string_length number;
  6.     emoluments number := 0;
  7. begin
  8.         SELECT PG.NAME 
  9. FROM HR.PER_ALL_ASSIGNMENTS_F PAAF, hr.PER_GRADES PG
  10. where PAAF.PERSON_ID = 1665 
  11. and PAAF.GRADE_ID = PG.GRADE_ID
  12. and PAAF.effective_end_date =
  13.     (select max(PAAF1.effective_end_date)
  14.      from hr.per_all_assignments_f PAAF1
  15.      where PAAF1.PERSON_ID = PAAF.person_id);
  16. first_position := instr(employee_grade,'.',1,1);
  17. last_position := instr(employee_grade,'.',1,2);
  18. string_length := last_position - (first_position + 1);
  19. employee_grade := substr(employee_grade,first_position + 1,string_length);
  20. IF upper(employee_grade) = 'IZ1' THEN
  21.     emoluments := 668;
  22. ELSIF upper(employee_grade) = 'IZ2' THEN
  23.     emoluments := 881;
  24. ELSIF upper(employee_grade) = 'IZ3' THEN
  25.     emoluments := 1404;
  26. ELSIF upper(employee_grade) = 'IZ4' THEN
  27.     emoluments := 1950;
  28. ELSIF upper(employee_grade) = 'IZ5' THEN
  29.     emoluments := 1434 + 954;
  30.     ELSIF upper(employee_grade) = 'IIZ2' THEN
  31.     emoluments := 1230 + 1230 + 898;
  32. ELSIF upper(employee_grade) = 'IIZ3' THEN
  33.     emoluments := 1076 + 1186 + 1186 + 1109;
  34. ELSIF upper(employee_grade) = 'IIZ4' THEN
  35.     emoluments := 1215 + 1491 + 1491 + 1368;
  36. ELSIF upper(employee_grade) = 'IS3' THEN
  37.     emoluments := 300 + 641;
  38. ELSIF upper(employee_grade) = 'IS4' THEN
  39.     emoluments := 300 + 695;
  40.     ELSE
  41.     emoluments := 0;
  42. END IF;
  43. return emoluments;
  44. end fnc_get_employee_emoluments;
  45.  
Now i compiled this and this runs fine ( returns the correct value), when run in toad.

I registered this in discoverer, and i am using this in calculation item.
It always returns 0. What could be the reason.

I have verified the person id that i am passing in my report. The function return correct value in toad for the same person id but not in my report.

Steps I used to register this function.

1) clicked on register pl/sql function in admin version
2) Clicked on import and searched for this in the available list of functions
3) after adding this, and the parameters, saved the content

In desktop , used the calculation item to retrieve this function.


vamsi
Jul 23 '09 #1
0 2606

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

Similar topics

3
3260
by: Ana RM | last post by:
Hi!! I am connecting Oracle Discoverer to Informix. The connection is OK. I can create an EUL in the Administrator, and make calcules, everything. My problem is that I cannnot connect to the Desktop. I use the same user and password as I used in the Administrator interface, and in connection I write the same: ODBC:informix. And it puts me...
0
1906
by: Ana RM | last post by:
Hi everybody, I have a problem in Discoverer. The point is that I don´t want to refresh data each time I open a workbook. I want to mantain old reports. If I open a report without connecting to the database it refreshes as well. Does it mean that Discoverer is not a portable tool? Do you know how to do it, not upgrading data?
0
3282
by: Paul Winter | last post by:
I'm new to both Oracle and Discoverer. Could someone point me in the direction of where to set the inactivity timeout for Discoverer Plus? Thanks Paul
1
3189
by: Monica Roman | last post by:
Hello, Disclaimer: I'm a TOTAL rookie. I just went through unistalling Oracle to be able to install Discoverer, which was succesful. (Our in-house Oracle support person said that if I did the Oracle_home renaming workaround, Oracle would not support it.) Now I just tried re-installing Oracle 9i and I encountered the same problem: it...
0
1290
by: 882900 | last post by:
hello people of the free world..... I'm upgrading my Oracle DB from 7 to 9.2 and I used to run discoverer 3 but now I dont know what discoverer version to use for the 9.2 any advice is more than welcome NG :)
1
2842
by: Ana RM | last post by:
Mark.Powell@eds.com (Mark D Powell) wrote in message news:<2687bb95.0308010642.1fc4ff1f@posting.google.com>... Hi Mark, Thanks por answer me. I do not think it is important thw warehouse knowledge to solve my problem because at the end all the tables are relational. The point is that I do not want make changes in the database, I want
1
4348
by: Ole Hansen | last post by:
Hi ! I am trying to learn how to use Oracle Discoverer. I have worked with databases, like Oracle for several years, but i am new to Discoverer. Does anybody know a place to download an "Oracle Discoverer for Dummies ...", or some other good tutorial for a newbie like me.
0
1489
by: vamsioracle | last post by:
Hi all I have installed oracle discoverer 4.1.37 on my machine and i have database 9i. Now i try to login in discoverer, it says tns no listner. I copied and replaced the tns.ora from ora92 which is home for database into ora93 which is the home for discoverer. still it doen't work can we login through scott/tiger which are database schemas?...
0
1258
by: vamsioracle | last post by:
Hi All I have a discoverer report already registeted in apps (employee leave balances). Now my client wants to rename the same report as " employee personal leave balances. Now i logged in with my account used for developement and used save as option to rename it. But none of the end users see that report in the list ( both in desktp and...
0
7532
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7461
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7730
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7971
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7823
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5101
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3509
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1068
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.