Oracle query/function problem
Posted on 2014-01-06
I have a table POL_DATA which has a foriegn key to another table POL_DATA_DETAILS...
POL_DATA_DETAILS has a primary key and the foreign key and has 2 columns POL_DATA_TITLE(VARCHAR2(100)) and POL_DATA_DESC(CLOB) that I need to return.
I am trying to query POL_DATA and JOIN POL_DATA_DETAILS to get the "multiple values" in the POL_DATA_TITLE and POL_DATA_DESC fields. SO obviously there are/can be multiple rows that exist in the Details table and I want to bring them back in a grid in my ASP app...
Ive done this before but I have forgot what I have done..I tried to create a function to bring both columns in the details back but I am failing
Select a.pol_title, a.pol_number, FUNC_POLICY_DETAILS(6), FUNC_POLICY_DETAILS_TEXT(6)
FROM POLICY_DATA a
Inner Join POLICY_DATA_DETAILS b ON a.POL_ID = b.POL_DATA_ID
Order By pol_number
Heres one function---
Select POL_DETAIL_TITLE into strTitle
Where POL_DATA_ID = nDetailID
Order By POL_DETAIL_ID;
Heres the error
ORA-01422: exact fetch returns more than requested number of rows
THANKS FOR ANY HELP!!!!