no data found despite data in the table
911779May 7 2012 — edited May 7 2012hello 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.