I'm trying to call an Oracle stored procedure within a package and I'm getting this error: SQL Error: ORA-06576: not a valid function or procedure name
I'm using SQL Developer and this is the command I'm using
call WEATHERDATAUPDATES.GetLastRunDate("WeatherData")
Here is the package/procedure
PACKAGE BODY WEATHERDATAUPDATES AS
PROCEDURE GetLastRunDate(PROCESS IN VARCHAR2, RUNDATE OUT DATE) AS
BEGIN
SELECT rundate FROM Marcie.last_rundate
where process = PROCESS;
END GetLastRunDate;
END WEATHERDATAUPDATES;
I'm pretty new to Oracle Packages and not sure what I'm missing. I tried searching, but can't find an answer that works. Can someone tell me what I'm missing?
Thanks, Marcie
In your procedure you are not putting the retrieved value anywhere, you should use INTO:
...
PROCEDURE GetLastRunDate(PROCESS IN VARCHAR2, RUNDATE OUT DATE) AS
BEGIN
SELECT rundate
INTO RUNDATE
FROM Marcie.last_rundate
where process = PROCESS;
END GetLastRunDate;
...
In the call pass the variable for the out parameter RUNDATE OUT DATE.
Put the call in a PL/SQL block:
DECLARE
lastRunDate DATE;
BEGIN
WEATHERDATAUPDATES.GetLastRunDate("WeatherData",lastRunDate);
-- do something with lastRunDate
END;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With