I have an Oracle function that I would like to make more generic that would work for any sequence. I would like to pass in the sequence name, then have the function return the CurrVal of that sequence. The following does work, but it is sequence specific:
CREATE OR REPLACE Function GetCurrVal
RETURN NUMBER
IS
nCurrVal NUMBER(8);
BEGIN
SELECT S_RegApps_Agents.CurrVal INTO nCurrVal FROM dual;
RETURN(nCurrVal);
END;
/
show error
I know this can be done with a simple SQL SELECT, but I have other reasons for needing to do this in a function. There is something screwy with Oracle returning a weird data type to Visual FoxPro. So I need the function to make sure the return data type is numeric. TIA!
Mark McCasland
Midlothian, TX USA