Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

no data found despite data in the table

911779May 7 2012 — edited May 7 2012
hello All,

I have a problen with a function. I get "no data found" exception despite the rows in the table exist. the code is pasted below
***************************************************
create or replace
FUNCTION GET_POT_NAME
(
RELATED_TYPE IN VARCHAR2,
PARENTID IN NUMBER
)
RETURN VARCHAR2 IS
POTNAME VARCHAR2(100);
sqlst VARCHAR2(100);
BEGIN
IF PARENTID > 0 then
SELECT POTENTIALNAME INTO POTNAME FROM CRM_POTENTIAL WHERE potentialid = PARENTID;
Else
POTNAME:='';
END IF;
RETURN POTNAME;
***************************************************
I have verified that the data exists in the table for a paretid 322. However I get the exception when the function is called with 322. I fire a select statement in the SQL developer query window and get the row displayed. This is happening with few of the tables and the function work ok on some other tables.

Please help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2012
Added on May 7 2012
10 comments
1,294 views