ORACLE using function parametes in where claus

Posted by Gainder on Stack Overflow See other posts from Stack Overflow or by Gainder
Published on 2010-05-24T20:17:24Z Indexed on 2010/05/24 20:21 UTC
Read the original article Hit count: 336

Filed under:
|

Hello, I have created a simple static function in oracle 10g to get the reference of an object based on his pk.

STATIC FUNCTION getRef(nome IN VARCHAR2) RETURN REF folder_typ IS fl_r REF folder_typ := null; BEGIN SELECT REF(fl) INTO fl_r FROM folder_tab fl WHERE fl.nome = nome; RETURN fl_r; END getRef;

This gives me an error because he could't fetch the row. If insted of WHERE fl.nome = nome; I write WHERE fl.nome = 'folder1'; insted of passing it as parameter it works.

I think im not using the parameter in the right way. How can I use it?

© Stack Overflow or respective owner

Related posts about sql

Related posts about Oracle