When does the below sql function can cause an exception other than NO DATA FOUND?
v_ExchangeRate is of type float.The datatype of rate column is NUMBER(14, 10) and this column can not contain NULL values.
BEGIN
SELECT rate
INTO v_ExchangeRate
FROM exchange_rate
WHERE currency_code = CurrencyCode
AND status = 'A';
The data type of exchange_rate in database is NUMBER(14,10)
Edit
Multiple rows cannot be returned by the where clause as the currency_code is the primary key.
Possible exceptions (not an exhaustive list by any means):
1) ORA-00942: table or view does not exist
2) ORA-06502: PL/SQL: numeric or value error: character to number conversion error
3) ORA-06502: PL/SQL: numeric or value error: character string buffer too small
4) ORA-01722: invalid number
Can you not create a copy of the function, remove the WHEN OTHERS part, and test it in SQL Plus or an IDE to see what exception you get?