Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Make Function More Generic
Message
 
 
To
All
General information
Forum:
Oracle
Category:
Triggers, Sequences and Stored Procedures
Title:
How to Make Function More Generic
Miscellaneous
Thread ID:
00966540
Message ID:
00966540
Views:
59
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
Reply
Map
View

Click here to load this message in the networking platform