The above query was taking time to execute and had to be performance improved, so I re-wrote the function as follows:

[code]

FUNCTION getVal(i_no NUMBER) RETURN varchar2

as

v_val;

begin

BEGIN

SELECT nm INTO v_val from table where num = i _no;

exception when no_data_found then

v_val='#';

end;

return v_val;

end;

[/code]

But i see that after I re-wrote the function with Native SQL, I see that the performance of the query has worsened, It is taking longer time in execution.

I thought removing the cursor and using Native SQL would improve performance. Please comment.

Thanks,

S

I'm having trouble believing that this is the function you're actually running. For one thing, table is not a valid table name in Oracle, and the parameter the cursor (i_no) is not used anywhere in the cursor.

What is your revised, native SQL version of the function?

Without seeing either the original version, or the revised version, I can't say much about them.