I am using function as
create or replace FUNCTION FSS_REF_GETREFIDBYCODEANDORDER (v_Code In CHAR, v_OrderBy In number )
RETURN number IS v_RefID NUMBER(10);
BEGIN
SELECT REFID
INTO v_RefID
FROM REFERENCE
WHERE Code like (v_Code || '%')
AND
ORDERBY = v_OrderBy
and ROWNUM = 1;
RETURN (v_RefID);
END;
It should return a Value because if I run it separately without function given below its giving the result as 1 desired 1 value
SELECT REFID
-- INTO v_RefID
FROM REFERENCE
WHERE Code like ('001' || '%')
AND
ORDERBY = 4
and ROWNUM = 1;
Can anybody please help me out with any error in function. As I am new in PL/SQL programming.
chardatatype instead of usingvarchar2. Yet, without any hint on how you call function nor if you get an error message, this is impossible to tell.