I am looking for good resources on Oracle Stored Procedure geared towards beginners. I tried the Dev Shed Article and one from Oracle Documentation site but they did not meet my needs. The one form Oracle Documentation site had the overhead of Java example. I tried the Dev Shed one but I keep getting invalid SQL error when I try their example. Here is the basic one that I tried to run:
CREATE OR REPLACE PROCEDURE skeleton
IS
BEGIN
NULL;
END;
EXECUTE skeleton;
Am I making a rookie mistake or is the syntax in the article out of date? I am working with Oracle 10g & PL/SQL Developer.
Thanks!
SOLUTION:
As per @curtisk's suggestion, I tried a slightly more involved example:
CREATE OR REPLACE PROCEDURE p_getdate
IS
BEGIN
dbms_output.put_line(TO_CHAR
(SYSDATE, 'MM-DD-YYYY HH24:MI:SS'));
END;
When I tried to execute it like so:
EXECUTE p_getdate
I got ORA-00900: Invalid SQL statement error. I looked for why this would be the case & stumbled across this thread. I decided to give call a try so I tried the following:
CALL p_getdate;
but that did not work as well. I read the thread some more & skeptically tried:
CALL p_getdate();
and voila, I had the procedure being called properly. I do not have an answer as to why this works but the fact that it works allows me to move forward with my project. If there is anyone who can explain to me why this is, I would love to learn more on this.
Thanks once again to @curtisk for the help!