ORACLE: Parameter reference in WHERE doesn't work
- by Gainder
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 it could't fetch a row.
If insted of WHERE fl.nome = nome; I write WHERE fl.nome = 'folder1'; -- it works.
I think im not using the parameter in the right way.
How can I use it?